Hello,
I have had trouble getting the DSPS to work on the DA14861 Dev Kit Pro. I started by adding the sps BLE service to the PXP Reporter demo app, and I could see the Serial Port Service, but whenever I would try to write to the RX characteristic the DA14681 seems to go into a reset state. I then decided maybe it was just an issue inside of PXP Reporter so I put the SPS in the ble_peripheral demo project and now there does not seem to be the crash into a reset state but the callback functions for the SPS do not seem to be firing whenever I send data to the Rx characteristic.
The code I added was very minimal:
/* SPS Serial Port Service instance */
PRIVILEGED_DATA静态ble_service_t * sps;
#define SPS_RX_BUFF_LEN 16
PRIVILEGED_DATA uint8_t sps_Rx_Buff[16];
/* Callback from SPS (Remote client wrote new value of flow control characteristic) */
static void sps_set_flow_control_cb(ble_service_t *svc, uint16_t conn_idx, sps_flow_control_t value)
{
//Flow Control Code
return;
}
/* Callback from SPS (Data received from remote client) */
static void sps_rx_data_cb(ble_service_t *svc, uint16_t conn_idx, const uint8_t *value,
uint16_t length)
{
if ( length <= SPS_RX_BUFF_LEN)
memcpy(sps_Rx_Buff, value, length);
//Rx Data Code
sps_tx_data(sps, conn_idx, sps_Rx_Buff, length);
return;
}
/* Callback from SPS (Service finished TX transaction) */
static void sps_tx_done_cb (ble_service_t *svc, uint16_t conn_idx, uint16_t length)
{
//Tx Done Code
return;
}
/* Put sps_callbacks into sps_callbacks_t structure */
sps_callbacks_t sps_callbacks = {sps_set_flow_control_cb, sps_rx_data_cb, sps_tx_done_cb};
And for setting up the service I have the following:
sps = sps_init(&sps_callbacks);
ble_service_add(sps);
I have no problems seeing the service, but it doesn't seem to be responding. I am a bit new to dialog so I may be missing something. Any guidance would be appreciated.
Is there any issues with using Android DSPS app and communicating with the SPS on DA14681?
Are there any code examples from Dialog that show the use of the SPS on the DA14681?
Thanks,
Josh
Hi jkraan,
Regarding the DSPS on the 68x, currently there is no implementation, only the profile layer is available, there is no application layer code, that means that you can add the code as a profile and be able to see the characteristics etc, but there is no actual application that will feed those characteristics with data over the UART, or manage the flow control, there is no release for the DSPS on the 68x yet.
Thanks MT_dialog