BLE mbed Endpoint network stack for mbedConnectorInterface. The stack makes use of a special BLE Socket abstraction to create socket() semantics over BLE.

Dependencies:   libnsdl_m0 BLE_API Base64 nRF51822 SplitterAssembler

Revision:
2:30f4a0dab604
Parent:
0:7809547930d9
Child:
6:98af441fd960
--- a/bt_network/Socket/Socket.cpp	Wed Feb 11 23:01:05 2015 +0000
+++ b/bt_network/Socket/Socket.cpp	Sat Feb 14 07:36:17 2015 +0000
@@ -20,6 +20,9 @@
 
 using std::memset;
 
+extern "C" void ble_build_disconnection_record();
+extern "C" void ble_send_disconnection_record(); 
+
 Socket::Socket() : _sock_fd(-1), _blocking(true), _timeout(1500) {
     
 }
@@ -30,12 +33,12 @@
 }
 
 int Socket::init_socket(int type) {
-    // XXX
+    // Not used for BLE shim
     return 0;
 }
 
 int Socket::select(struct timeval *timeout, bool read, bool write) {
-    // XXX
+    // Not used for BLE shim...
     return 0;
 }
 
@@ -48,7 +51,8 @@
 }
 
 int Socket::close(bool shutdown) {
-   // XXX
+   ble_build_disconnection_record();
+   ble_send_disconnection_record();
    return 0;
 }