需求描述
项目描述:
一、项目背景
目前我司计划做一个跨平台的(包括RTOS(Zephyr/RT-Thread…)、Linux等)的Ezplay框架,目的是无论换什么方案的芯片都可以快速移植,并做到功能统一。
Ezplay是基于CEC的一套扩展协议,主要使用CEC的标准厂商自定义指令VendorCommandWithID(0xA0)进行的私有协议定义;Soundbar的vendor ID为0x778899,可修改以便将来扩展其它品牌。
设计要求:
1.可以请求TV的vendor ID并保存.
2. 当收到TV端发送过来调整音效的参数的时候需要做身份识别,如果vendor ID不匹配时需要丢弃(≠Soundbar vendor ID).
3.当Sound bar自身的参数发生改变的时候,需要发送vendor command with id指令给TV,TV需要接收并解析其中的参数.
Soundbar端的指令格式:src+dst+0xA0+vendor id+params
params表示参数,具体由以下几位组成:
params = hsOpcode+Item+hsParams,
函数命名风格:
返回值 库前缀_模块名_函数名(参数1,参数2,....)
如:int32 mw_ezplay_send_message(uint8_t* message,uint8_t messageSize);
二、需要开发的功能
ezplay需要实现的功能接口如:
1. int32 mw_ezplay_process_message(uint8_t* message,uint8_t messageSize);/*message消息内容=vendor id+params, messageSize表示消息长度*/
2. int32 mw_ezplay_send_message(uint8_t* message,uint8_t messageSize)/*message消息内容=vendor id+params,, messageSize表示消息长度*/
3. int32 mw_ezplay_report_support_features(uint32 supportFeature );/*supportFeature是根据产品能力定义的一个常量,hsOpcode =0x91*/
4. int32 mw_ezplay_report_device_id(uint8_t* deviceID,uint8_t deviceIDSize)/*hsOpcode =0x95,deviceID表示一个设备的唯一序列号,deviceIDSize表示长度*/
5. int32 mw_ezplay_report_all_params(uint8_t* params,uint8_t paramsSize);/*hsOpcode = 0xA1, params表示上报的参数内容,paramsSize表示参数长度*/
6. int32 mw_ezplay_process_item_value(uint8_t item,uint8_t value)/*item表示对象,value表示要设置的值,针对hsOpcode=0xA2场景*/
7. int32 mw_ezplay_report_item_value(uint8_t item,uint8_t value)/*hsOpcode=0xA4,item表示对象,value表示更新后的值,适用于TV或app等改变item value的场景*/
8. int32 mw_ezplay_update_item_value(uint8_t item,uint8_t value)/*hsOpcode=0xA5,item表示对象,value表示更新后的值,适用于设备端主动改变item value的场景*/
9. int32 mw_ezplay_reset_all_params(void);/*所有的参数恢复到默认值,比如EQ、Surround、Bass、Treble等并通过mw_ezplay_report_all_params函数上报*/
10. int32 mw_ezplay_set_volume(uint8_t volume)/*hsOpcode=0xAC,volume从params中解析*/
11. int32 mw_ezplay_report_item_range(uint8_t item,uint8_t length,uint8_t rangeMap)/*hsOpcode=0xB3,item表示对象,length表示rangeMap的长度,rangeMap表示item支持的位图表*/
12. int32 mw_ezplay_set_switch_features(uint8_t length,uint8_t switch1,...)/*hsOpcode=0xB4,length表示switch的个数*/
13. int32 mw_ezplay_report_switch_features(uint8_t length,uint8_t switch1,...)/*hsOpcode=0xB6,length表示switch的个数,switch的值用switch1...表示*/
........还有部分需求可以加微信具体交流。
2. 定义其它模块调用接口:
int32 mw_cec_send_message(uint8_t* message,uint8_t messageSize)/*message消息内容=vendor id+params,, messageSize表示消息长度*/
该函数负责将ezplay模块消息发送cec的消息队列中,这个接口无需实现,最终由cec模块负责实现;
对audio模块的接口需求
mw_audio_get_item_value(uint8_t item)
mw_audio_set_item_value(uint8_t item,uint8_t value)
mw_audio_reset_all_params()//to be defined
mw_audio_set_volume(uint8_t volume)
mw_audio_send_calibration_params(uint8_t* params)
mw_audio_report_acoustic_process(uint8_t process)
Ezplay模块和CEC模块、Audio模块的关系;Audio模块值改变之后需要告知Ezplay模块;
需求版本记录
V1 · 2026-11-14 15:37:24 · 发布需求