⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
Dave.Renzo
Offline
Last seen:2 years 7 months ago
加入:2015-10-08 13:21
需求方BLE流控制

Hi, I'm working on a design that uses a da14580 (murata type zy module) using the dialog serial port service. Everything is working well using the dialog supplied android app, I am able to send and receive data from my hardware, so far the DSPS has been essentially plug and play.

I am now at the point where I have to dig into the details a bit and I have some question regarding the SPS_FLOW_CTRL characteristic. I don't really understand what it's doing. Transmitting from the da14580 dosn't cause any notifications and transmitting from the central device (android phone) seems to work without having to read or write to the flow control characteristic. What am I missing here? Any insight would be greatly appreciated.

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi Dave.Renzo,

Hi Dave.Renzo,

I am not sure i get the question exactly, the flow on and flow off characteristic is updated via the user_send_ble_flow_ctrl() function the flow control signals on the central and on the peripheral are issued as soon as the buffers used to store the data are above a specific watermark and also the characteristic is updated when a flow control signal is received via the UART port. For example on the sps_device the user_send_ble_flow_ctrl() is used in the ble_periph_pull() in order to send data over the UART and sets the flow control signal to ON depending on the watermark value and also used in the user_ble_push() function where again the watermark in the buffer is checked and again invokes the user_send_ble_flow_ctrl() in order to send an OFF signal. Also the function is used in the user_override_ble_xoff() and user_override_ble_xon() function where the flow control in the BLE is updated depending on the UART flow control state. Regarding the client side, the state of the flow control over the BLE interface is controlled via the SPS_CLIENT_TX_FLOW_CTRL_IND message (this is what informs the application), so as soon as there is a notification from the peripheral side this message is send to the central application layer (the message doesn't actualy does anything besides printing some debugging messages) but before sending the actual message the enviroment varaible of the application spsc_env->tx_flow_en is set to true (you can check this in the gattc_event_ind_handler), so this variable is checked by the central before any attemp to write (send data) to the characteristic of the peripheral. Please check the User Manual of the Serial Port Service reference application (UM-B-038), most of the applications mechanisms are explained there, including the flow control mechanism.

Thanks MT_dialog