//========================================================================================================
/*版权声明:本文为樱桃BLE原创文章,Q群:376066563 转载请注明出处*/
/*2016-12-22 微信硬件 微信蓝牙外设协议1.0.4 MmBp_Embedded_1.0.4移植记录一*/
/*
IAR版本 IAR9.30.3
BLE栈版本 BLE-CC254x-1.4.2.2
微信协议版本微信蓝牙外设协议1.0.4 MmBp_Embedded_1.0.4
*/
/*protobuf移植记录及详解*/
/*例程为 BLE-CC254x-1.4.2.2\Projects\ble\SimpleBLEPeripheral*/
/*
第一步 增加group组 MmBp_Embedded_1.0.4\protobuf 到CC2541工程,增加protobu下的三个C文件到工程
*/
/*
第二步
打开编译器 C/C++cOMPLIER Preprocessor选项,增加两条记录
$PROJ_DIR$\..\..\SimpleBLEPeripheral\Source\MmBp_Embedded_1.0.4\protobuf
$PROJ_DIR$\..\..\SimpleBLEPeripheral\Source
*/
/*
第三步:定义头文件 main.h 存放到 BLE-CC254x-1.4.2.2\Projects\ble\SimpleBLEPeripheral\Source 目录中
//========================================================================================================
#ifndef __main_h
#define __main_h
//========================================================================================================
/*以下头文件以及重定义替换 头文件 #include <stdint.h>*/
#include "hal_types.h"
typedef signed char int8_t; //!< Signed 8 bit integer
typedef unsigned char uint8_t; //!< Unsigned 8 bit integer
typedef signed short int16_t; //!< Signed 16 bit integer
typedef unsigned short uint16_t; //!< Unsigned 16 bit integer
typedef signed long int32_t; //!< Signed 32 bit integer
typedef unsigned long uint32_t; //!< Unsigned 32 bit integer
/*结束头文件 头文件 #include <stdint.h> 替换*/
//========================================================================================================
//========================================================================================================
#endif
*/
/*
第四步
打开epb.h 用头文件 #include "main.h" 替换掉头文件 #include <stdint.h>
打开epb_MmBp.h 用头文件 #include "main.h" 替换掉头文件 #include <stdint.h>
*/
/*
第五步重新编译查看是否通过,没通过请核对协议栈版本以及IAR版本
*/
/*版权声明:本文为樱桃BLE原创文章,Q群:376066563 转载请注明出处*/
//========================================================================================================
/*
文件解释
epb.h 打包解包工具protobufC代码
解包初始化 void epb_unpack_init(Epb *e, const uint8_t *buf, int len);
打包初始化 void epb_pack_init(Epb *e, uint8_t *buf, int len);
打包数据大小 int epb_get_packed_size(Epb *e);
epb_MmBp.h 打包解包工具微信相关protobuf代码
epb_WristBand.h 打包解包微信RTC时间相关代码
*/
//========================================================================================================
2016-12-22 微信硬件 微信蓝牙外设协议1.0.4 MmBp_Embedded_1.0.4移植记录一
最新推荐文章于 2022-07-02 11:41:54 发布