123456789101112131415161718192021222324252627282930313233343536373839 |
- #include "app_losspack.h"
- #include "bsp_time.h"
- #include "app_flash.h"
- #include "system.h"
- #include "hal_ble_client.h"
- #include "ble_comm.h"
- #if LOSSPACK_ENANBLE
- uint16_t lose_pack_all =0;
- void LossPack_process(void){
-
- uint16_t pack_l =0;
-
- uint8_t rssi = 0-host_get_rssi();
-
- pack_l = lose_pack_all;
- uint8_t buf[8];
- uint8_t L = 0;
- buf[L++] = (uint8_t)(pack_l>>8);
- buf[L++] = (uint8_t)(pack_l);
- buf[L++] = (uint8_t)(rssi);
- BLE_Client_Tx_Send(0,(BLE_CMD_n)0x03,buf,L);
- // SEGGER_RTT_printf(0,"lose_pack_all:%d, h_rssi=%d\r\n",lose_pack_all,rssi);
-
- lose_pack_all = 0;
- }
- void app_losspack_Init(void)
- {
- if(mFlash.isHost)Process_Start(1000,"LossPack_process",LossPack_process);
- }
- #endif
|