#include "app_losspack.h" #include "bsp_time.h" #include "app_flash.h" #include "system.h" #include "hal_ble_client.h" #include "ble_comm.h" #include "app_game.h" #if LOSSPACK_ENANBLE uint16_t lose_pack_all =0; void LossPack_process(void){ if(app_game_GetGameMode()){ 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); // DEBUG_LOG("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