Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: libnsdl_m0 BLE_API Base64 nRF51822 SplitterAssembler
Diff: bt_network/BleUartRPC/UartRPC.cpp
- Revision:
- 16:fb9c3f2af2df
- Parent:
- 11:d601b867b297
- Child:
- 33:4f6929e123f2
--- a/bt_network/BleUartRPC/UartRPC.cpp Thu Mar 05 18:23:37 2015 +0000
+++ b/bt_network/BleUartRPC/UartRPC.cpp Mon Mar 16 16:10:55 2015 +0000
@@ -63,7 +63,7 @@
int length = this->m_recv_accumulator.assemble(__tmp_buffer,MAX_ARGUMENT_LENGTH);
// DEBUG
- DBG("UartRPC: dispatch(local): buffer [%s] length=%d\r\n",__tmp_buffer,length);
+ //DBG("UartRPC: dispatch(local): buffer [%s] length=%d\r\n",__tmp_buffer,length);
// parse the buffer
memset(base64_buffer,0,MAX_RESULT_LENGTH+1);
@@ -85,26 +85,26 @@
//DBG("UartRPC: dispatch(local): fn_id = 0x%.2x base64_buffer = [%s] length=%d\r\n",fn_id,base64_buffer,base64_buffer_length);
// invoke the appropriate function
- DBG("UartRPC: dispatch(local): requested function ID: 0x%.2x...\r\n",fn_id);
+ //DBG("UartRPC: dispatch(local): requested function ID: 0x%.2x...\r\n",fn_id);
switch(fn_id) {
case SOCKET_OPEN_FN: {
// socket open has been attempted... call the CB if it exists and process the status
- DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN length=%d\r\n",base64_buffer_length);
+ //DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN length=%d\r\n",base64_buffer_length);
if (this->m_cb != NULL) {
// cast the callback
ble_dispatch_callback_fn cb = (ble_dispatch_callback_fn)this->m_cb;
// parse the packet received for the status
bool open_ok = false;
- DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN socket open status: [%s]\r\n",base64_buffer);
+ //DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN socket open status: [%s]\r\n",base64_buffer);
int int_open_ok = 0;
sscanf((char *)base64_buffer,"%d",&int_open_ok);
if (int_open_ok == 1) open_ok = true;
// invoke the callback with the status
- DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN: invoking socket open callback (status: %d)...\r\n",int_open_ok);
+ //DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN: invoking socket open callback (status: %d)...\r\n",int_open_ok);
cb(open_ok);
- DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN: callback for socket open (status: %d) completed...\r\n",int_open_ok);
+ //DBG("UartRPC: dispatch(local): SOCKET_OPEN_FN: callback for socket open (status: %d) completed...\r\n",int_open_ok);
}
else {
// no callback given... so we are stuck...
@@ -117,18 +117,18 @@
}
case RECV_DATA_FN: {
// reset our local dispatch
- DBG("UartRPC: dispatch(local): resetting...\r\n");
+ //DBG("UartRPC: dispatch(local): resetting...\r\n");
this->resetLocalDispatch();
// decode the arguments and save off the local dispatch...
- DBG("UartRPC: dispatch(local): base64 decoding...\r\n");
+ //DBG("UartRPC: dispatch(local): base64 decoding...\r\n");
Base64 b64;
base64_buffer_length = final_length;
this->m_recv_raw_data = b64.Decode((char *)base64_buffer,strlen((char *)base64_buffer),(std::size_t *)&base64_buffer_length);
this->m_recv_raw_data_length = base64_buffer_length; // modified by Decode()....
// only RECV_DATA_FN is local... make it ready for retrieval and flag it as ready...
- DBG("UartRPC: dispatch(local): RECV_DATA_FN length=%d\r\n",this->m_recv_raw_data_length);
+ //DBG("UartRPC: dispatch(local): RECV_DATA_FN length=%d\r\n",this->m_recv_raw_data_length);
// local dispatch is now ready...
this->m_local_dispatch_available = true;