#include "system.h" #include "app_client_infomation.h" #include "app_flash.h" #include "bsp_time.h" #include "system.h" #include "app_host.h" #include "app_step.h" #include "hal_ble_client.h" #include "ble_gap.h" void app_client_infomation_Send_defineName(uint8_t name[],uint8_t lenth) { //<< 0(设备基本信息): 设备型号(64)+左鞋蓝牙地址(6)+硬件版本(2)+软件版本(2)+左鞋蓝牙地址(6)+硬件版本(6)+软件版本(2) ble_gap_addr_t mAddr; uint32_t err_code; uint8_t buf[128]; uint8_t L = SHOES_NAME_LEN+1; memset(buf,0,sizeof(buf)); //子命令 buf[0] = BLE_Client_T_UPDATE_BASEINFO; //设备名称 for(int i=0;i>8); buf[L++] = (uint8_t)((uint16_t)HARDWARE_VERSION>>0); //软件版本 buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>8); buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>0); //右鞋mac地址 for(int i=0;i<6;i++) buf[L++] = mFlash.mClient.macAddr[i]; //右鞋硬件版本 //buf[L++] = (uint8_t)(mFlash.mClient.hardVersion>>8); //buf[L++] = (uint8_t)(mFlash.mClient.hardVersion>>0); buf[L++] = (uint8_t)((uint16_t)HARDWARE_VERSION>>8); buf[L++] = (uint8_t)((uint16_t)HARDWARE_VERSION>>0); //右鞋软件版本 buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>8); buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>0); BLE_Client_Tx_Send(0,BLE_UPDATE,buf,L); } void app_client_infomation_Send(void) { //<< 0(设备基本信息): 设备型号(64)+左鞋蓝牙地址(6)+硬件版本(2)+软件版本(2)+左鞋蓝牙地址(6)+硬件版本(6)+软件版本(2) ble_gap_addr_t mAddr; uint32_t err_code; uint8_t buf[128]; uint8_t L = SHOES_NAME_LEN+1; memset(buf,0,sizeof(buf)); //子命令 buf[0] = BLE_Client_T_UPDATE_BASEINFO; //设备名称 for(int i=0;i>8); buf[L++] = (uint8_t)((uint16_t)HARDWARE_VERSION>>0); //软件版本 buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>8); buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>0); //右鞋mac地址 for(int i=0;i<6;i++) buf[L++] = mFlash.mClient.macAddr[i]; // SEGGER_RTT_printf(0,"mac addr:");for(int i=0;i<6;i++){SEGGER_RTT_printf(0,"%02X ",mFlash.mClient.macAddr[i]);}SEGGER_RTT_printf(0,"\n"); //右鞋硬件版本 //buf[L++] = (uint8_t)(mFlash.mClient.hardVersion>>8); //buf[L++] = (uint8_t)(mFlash.mClient.hardVersion>>0); buf[L++] = (uint8_t)((uint16_t)HARDWARE_VERSION>>8); buf[L++] = (uint8_t)((uint16_t)HARDWARE_VERSION>>0); //右鞋软件版本 buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>8); buf[L++] = (uint8_t)((uint16_t)SOFTWARE_VERSION>>0); BLE_Client_Tx_Send(0,BLE_UPDATE,buf,L); }