首页 > 其他分享 >[ANT+][nrf51422][s210] 自行车车灯 数据第17页–联网灯的产品信息(0x11)

[ANT+][nrf51422][s210] 自行车车灯 数据第17页–联网灯的产品信息(0x11)

时间:2022-10-31 21:00:35浏览次数:59  
标签:s210 17 BikeLight Number uint8 ANT Serial data page


数据页17是处于连接状态时从ANT+自行车灯广播的数据页之一。所有主灯应根据控制器的要求发送此页面。作为数据页轮发的一部分,可以可选地将此页作为从ANT+自行车灯广播的主要数据页之一包括在内。该消息中的所有字段均应按表7-27所述进行设置。

[ANT+][nrf51422][s210] 自行车车灯 数据第17页–联网灯的产品信息(0x11)_ble

7.12.1. 软件修订
SW版本由制造商管理,并指定在传输设备上运行的软件的版本。如果字节2和3均有效,则这些字段应解释为主软件版本和补充软件版本。
例如,如果制造商使用软件修订版格式:
软件修订版= 1.380,其中“1.3”是主软件修订版,“80”是补充软件修订版
编码如下:
主软件修订版= 13(因为在此字段中只能发送整数值)
补充软件修订版= 80
如果仅使用“主软件修订”字段,则其值由制造商定义。在这种情况下,补充SW修订字段应设置为0xFF。

/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/

#include "ant_BikeLight_page_17.h"
#include "ant_BikeLight_utils.h"
#include "ant_BikeLight_page_logger.h"
#include "SEGGER_RTT.h"
#include "SEGGER_RTT_Conf.h"
#include "main.h"
/**@brief BikeLight 联网灯的产品信息 第17页数据布局结构. */
typedef struct
{
uint8_t Light_Index; //灯光索引 2-63

uint8_t SW_Revision; //软件件修订
uint8_t SW_Revision_Main; //软件件修订

uint8_t Serial_Number_0_7; //序列号(位0 – 7)
uint8_t Serial_Number_8_15; //序列号(位8 – 15)
uint8_t Serial_Number_16_23; //序列号(位16 – 23)
uint8_t Serial_Number_24_31; //序列号(位24 – 31)

} ant_BikeLight_page17_data_layout_t;


static void page17_data_log(ant_BikeLight_page17_data_t const *p_page_data)
{
// SEGGER_RTT_printf(0, "Light_Index: %d\r\n", (uint8_t)p_page_data->Light_Index);
// SEGGER_RTT_printf(0, "AutoIntensityMode: %d\r\n", (uint8_t)p_page_data->Light_Properties_AutoIntensityMode);
// SEGGER_RTT_printf(0, "Beam: %d\r\n", (uint8_t)p_page_data->Light_Properties_Beam);
// SEGGER_RTT_printf(0, "SupportedModes: %d\r\n", (uint8_t)p_page_data->Light_Properties_SupportedModes);
// SEGGER_RTT_printf(0, "Battery_Capacity: %d\r\n", (uint8_t)p_page_data->Battery_Capacity);
}


void ant_BikeLight_page_17_encode(uint8_t *p_page_buffer,
ant_BikeLight_page17_data_t const *p_page_data)
{
ant_BikeLight_page17_data_layout_t *p_outcoming_data = (ant_BikeLight_page17_data_layout_t *)p_page_buffer;

p_outcoming_data->Light_Index = p_page_data->Light_Index;
p_outcoming_data->SW_Revision = p_page_data->SW_Revision;
p_outcoming_data->SW_Revision_Main = p_page_data->SW_Revision_Main;
p_outcoming_data->Serial_Number_0_7 = p_page_data->Serial_Number_0_7;
p_outcoming_data->Serial_Number_8_15 = p_page_data->Serial_Number_8_15;
p_outcoming_data->Serial_Number_16_23 = p_page_data->Serial_Number_16_23;
p_outcoming_data->Serial_Number_24_31 = p_page_data->Serial_Number_24_31;

ANT_PAGE_NEW = 0;
page17_data_log(p_page_data);
}


void ant_BikeLight_page_17_decode(uint8_t const *p_page_buffer,
ant_BikeLight_page17_data_t *p_page_data)
{
ant_BikeLight_page17_data_layout_t const *p_incoming_data =
(ant_BikeLight_page17_data_layout_t *)p_page_buffer;

p_page_data->Light_Index = p_incoming_data->Light_Index;
p_page_data->SW_Revision = p_incoming_data->SW_Revision;
p_page_data->SW_Revision_Main = p_incoming_data->SW_Revision_Main;
p_page_data->Serial_Number_0_7 = p_incoming_data->Serial_Number_0_7;
p_page_data->Serial_Number_8_15 = p_incoming_data->Serial_Number_8_15;
p_page_data->Serial_Number_16_23 = p_incoming_data->Serial_Number_16_23;
p_page_data->Serial_Number_24_31 = p_incoming_data->Serial_Number_24_31;

/*处理信息*/
page17_data_log(p_page_data);
}
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#ifndef ANT_BIKELIGHT_PAGE_17_H__
#define ANT_BIKELIGHT_PAGE_17_H__

#include <stdint.h>

typedef struct
{
uint8_t Light_Index; //灯光索引 2-63

uint8_t SW_Revision; //软件件修订
uint8_t SW_Revision_Main; //软件件修订

uint8_t Serial_Number_0_7; //序列号(位0 – 7)
uint8_t Serial_Number_8_15; //序列号(位8 – 15)
uint8_t Serial_Number_16_23; //序列号(位16 – 23)
uint8_t Serial_Number_24_31; //序列号(位24 – 31)
} ant_BikeLight_page17_data_t;


#define DEFAULT_ANT_BikeLight_PAGE17() \
(ant_BikeLight_page17_data_t) \
{ \
.Light_Index = 2, \
.SW_Revision = 81, \
.SW_Revision_Main = 95, \
.Serial_Number_0_7 = 95, \
.Serial_Number_8_15 = 8, \
.Serial_Number_16_23 = 1, \
.Serial_Number_24_31 = 0, \
}


void ant_BikeLight_page_17_encode(uint8_t *p_page_buffer,
ant_BikeLight_page17_data_t const *p_page_data);


void ant_BikeLight_page_17_decode(uint8_t const *p_page_buffer,
ant_BikeLight_page17_data_t *p_page_data);

#endif // ANT_BIKELIGHT_PAGE_17_H__
/** @} */


标签:s210,17,BikeLight,Number,uint8,ANT,Serial,data,page
From: https://blog.51cto.com/xuejianqiang/5811280

相关文章

  • ANT+ 自行车车灯 数据页16 –互联灯的制造商信息(0x10)
    数据页16是当处于连接状态时从ANT+自行车灯广播的数据页之一。所有主灯应根据控制器的要求发送本页。作为数据页旋转的一部分,该页可以可选地包括为从ANT+自行车灯广播的主要......
  • ANT+ 自行车车灯 数据页18页-主光的频道ID(0x12)
    数据页18应在ANT+控制器的请求下发送,并且可以选择性地包括在连接状态下作为从ANT+自行车灯广播的主要数据页之一。这个数据页允许控制器发现并连接到已经存在的网络,如5.2.2.......
  • [nrf52][SDK17] 如何修改BLE_MAC地址?
    关键部分:ble_gap_addr_tble_mac_addr={0};sd_ble_gap_addr_get(&ble_mac_addr);//先获取ble当前mac地址ble_mac_addr.addr[0]++;//地址加1.......
  • [nrf52][SDK17] 如何使用官方BootLoader
    所需文件已经编译完毕,直接放入指定目录。**\nRF5_SDK_17.0.2_d674dde\external\micro-ecc​​micro-ecc.rar​​BootLoader工程位置xx\nRF5_SDK_17.0.2_d674dde\examples\d......
  • [nrf52][SDK17] FDS的GC操作
    本文介绍FDS库的GC操作。1.GC是什么在FDS的概念中,写入Flash的数据以Record的形式保存。Record的格式为:Flash只能以32-bit的字(Word)为单位进行写操作。RecordHeader包含三个......
  • [nrf52][SDK17] 弄懂FDS
    1.基础nRF52系列芯片都是Cortex-M4内核,芯片的Flash操作由NVMC(Non-volatilememorycontroller)管理,读写擦的机制相同:写:以Word(4字节)为单位进行Flash写操作。写入地址要Word......
  • Vagrant定制个性化CentOS7模板
    欢迎访问我的GitHub这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos关于虚拟机模板想用vagrant搭建hadoop集群,要完成以下准备工作......
  • 百度在线盘,没有VIP,Antdownload,又一款度盘不限速下载器!
    目前,百度网盘在非会员状态下,下载相关资源,速度仍然是几十KB/S,这龟速实在难受。百度网盘速度限制,我提供了多种方法来“解除速度限制”。满速下载百度网盘资源的方法总共有两类......
  • codeforces 1734C、1733D1、1733C、1730C、1729D
    1、1734CRemovingSmallestMultiples题意:给予你一个数组S,其中包含前n个正整数你可以在S上执行以下操作任多次(包含0次):1、选择一个正整数i,(1<=k<=n),并且使得数组S中......
  • angular8 antd design 中Select选择器allowClear清除属性失效和单个点击删除
    解决方法1:参考链接:https://blog.51cto.com/u_15064644/4338712解决方法二:changeDetectorRef.detectChanges() <nz-selectnzMode="tags" name="tests"[(ngModel)]=......