4S Device Communication Module Collection  Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
bluetooth.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2015 The 4S Foundation (www.4s-online.dk)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
36 #ifndef BLUETOOTH_H
37 #define BLUETOOTH_H
38 
39 #include "personalhealthdevice.h"
40 #include "FSYS/msgreceiver.h"
41 #include "4SDC/core.h"
42 #include "FSYS/moduledeclare.h"
43 
44 
45 
46 
47 
48 namespace PAL {
49 
65  public FSYS::Module {
66 
67 public:
68 
78 
83 
95  void msgGoingDown();
96 
97 
98 
99  /* ************************************************************ */
100  /* PHDBluetoothProvider (communicating with HDP devices) */
101  /* ************************************************************ */
102 
113  void registerDatatype(uint16_t datatype) noexcept;
114 
125  void unregisterDatatype(uint16_t datatype) noexcept;
126 
138  void sendApduPrimary(std::shared_ptr<PAL::VirtualPHD> device,
139  std::shared_ptr<std::vector<uint8_t> > apdu) noexcept;
140 
151  void sendApduStreaming(std::shared_ptr<PAL::VirtualPHD> device,
152  std::shared_ptr<std::vector<uint8_t> > apdu) noexcept;
153 
163  void disconnect(std::shared_ptr<PAL::VirtualPHD> device) noexcept;
164 
165 private:
166  // The internal parts of this class
168  friend class PrivateBluetoothModule;
169  PrivateBluetoothModule *privateParts;
170 
171 };
172 
173 } // namespace PAL
174 
175 #endif // BLUETOOTH_H
PAL layer interface for personal health device communication.
void sendApduPrimary(std::shared_ptr< PAL::VirtualPHD > device, std::shared_ptr< std::vector< uint8_t > > apdu) noexcept
Send a message to this device on the primary channel.
Definition: bluedroid.cpp:1248
Contains interface declaration for the FSYS::MsgReceiver class.
Interface file for the 4SDC.
void msgGoingDown()
Will stop the module and (relatively gracefully) disconnect any open connections. ...
Definition: bluedroid.cpp:1233
Base class for all modules.
Definition: moduledeclare.h:174
Definition: android.h:45
void unregisterDatatype(uint16_t datatype) noexcept
Session-layer components are no longer registered to handle this datatype.
Definition: bluedroid.cpp:1243
BluetoothModule()
Launch and initialize the Bluetooth module.
Definition: bluedroid.cpp:1224
Contains the declaration of the module defining macros and classes.
Bluetooth PAL-layer module wrapper class.
Definition: bluetooth.h:64
void disconnect(std::shared_ptr< PAL::VirtualPHD > device) noexcept
Session-layer component request to disconnect a device.
Definition: bluedroid.cpp:1260
void sendApduStreaming(std::shared_ptr< PAL::VirtualPHD > device, std::shared_ptr< std::vector< uint8_t > > apdu) noexcept
Send a message to this device on a streaming channel.
Definition: bluedroid.cpp:1254
~BluetoothModule()
Free resources used by the Bluetooth module.
Definition: bluedroid.cpp:1227
Bluetooth specialisation of the PersonalHealthDeviceProviderBase.
Definition: personalhealthdevice.h:721
void registerDatatype(uint16_t datatype) noexcept
A session-layer component has been registered as handler of a datatype.
Definition: bluedroid.cpp:1238