@@ -57,7 +57,7 @@ static uint8_t ot_plat_ble_msg_buf[PLAT_BLE_MSG_DATA_MAX];
5757
5858static K_SEM_DEFINE (ot_plat_ble_init_semaphore , 0 , 1 ) ;
5959static K_SEM_DEFINE (ot_plat_ble_event_semaphore , 0 , K_SEM_MAX_LIMIT );
60- RING_BUF_DECLARE (ot_plat_ble_ring_buf , CONFIG_OPENTHREAD_BLE_TCAT_RING_BUF_SIZE );
60+ RING_BUFFER_DECLARE (ot_plat_ble_ring_buf , CONFIG_OPENTHREAD_BLE_TCAT_RING_BUF_SIZE );
6161static K_THREAD_DEFINE (ot_plat_ble_tid , CONFIG_OPENTHREAD_BLE_TCAT_THREAD_STACK_SIZE ,
6262 ot_plat_ble_thread , NULL, NULL, NULL, 5 , 0 , PLAT_BLE_THREAD_DEALY ) ;
6363
@@ -126,11 +126,11 @@ static bool ot_plat_ble_queue_msg(const uint8_t *aData, uint16_t aLen, int8_t aR
126126
127127 len = sizeof (aLen ) + sizeof (aRssi ) + ((aLen <= PLAT_BLE_MSG_DATA_MAX ) ? aLen : 0 );
128128
129- if (ring_buf_space_get (& ot_plat_ble_ring_buf ) >= len ) {
130- ring_buf_put (& ot_plat_ble_ring_buf , (uint8_t * )& aLen , sizeof (aLen ));
131- ring_buf_put (& ot_plat_ble_ring_buf , & aRssi , sizeof (aRssi ));
129+ if (ring_buffer_space (& ot_plat_ble_ring_buf ) >= len ) {
130+ ring_buffer_write (& ot_plat_ble_ring_buf , (uint8_t * )& aLen , sizeof (aLen ));
131+ ring_buffer_write (& ot_plat_ble_ring_buf , & aRssi , sizeof (aRssi ));
132132 if (aLen <= PLAT_BLE_MSG_DATA_MAX ) {
133- ring_buf_put (& ot_plat_ble_ring_buf , aData , aLen );
133+ ring_buffer_write (& ot_plat_ble_ring_buf , aData , aLen );
134134 }
135135 k_sem_give (& ot_plat_ble_event_semaphore );
136136 } else {
@@ -156,10 +156,10 @@ static void ot_plat_ble_thread(void *unused1, void *unused2, void *unused3)
156156
157157 while (1 ) {
158158 k_sem_take (& ot_plat_ble_event_semaphore , K_FOREVER );
159- ring_buf_get (& ot_plat_ble_ring_buf , (uint8_t * )& len , sizeof (len ));
160- ring_buf_get (& ot_plat_ble_ring_buf , & rssi , sizeof (rssi ));
159+ ring_buffer_read (& ot_plat_ble_ring_buf , (uint8_t * )& len , sizeof (len ));
160+ ring_buffer_read (& ot_plat_ble_ring_buf , & rssi , sizeof (rssi ));
161161 if (len <= PLAT_BLE_MSG_DATA_MAX ) {
162- ring_buf_get (& ot_plat_ble_ring_buf , ot_plat_ble_msg_buf , len );
162+ ring_buffer_read (& ot_plat_ble_ring_buf , ot_plat_ble_msg_buf , len );
163163 }
164164
165165 openthread_mutex_lock ();
0 commit comments