




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Bluetooth相关说 sdk代码目 APP编写说 bt打开和关 API说 int 介绍Tina蓝牙应用开发接口和Demo TinaappBluetoothAllwinner └─> >bluetooth- BTapp注意:如果要参考蓝牙appdemo 蓝牙APPdemoAPIintbt_on(charMACbt_addrNULLMAC地址。intbt_on_no_avrcp(charMACbt_addrNULLMAC地址。int无int无bt_addr蓝牙设备地址。蓝牙设备地址结构见BT_ADDRintint无无typedefvoid(tBtCallback)(BT_EVENTevent,void*reply,intBT_EVENT底层蓝牙传递给APP的event。BT_AVK_CONNECTED_EVT, =>媒体音频连接建立BT_AVK_DISCONNECTED_EVT, =>媒体音频连接断开BT_AVK_START_EVT, =>音乐开始播放BT_AVK_STOP_EVT, =>音乐停止播放BT_HS_CONNECTED_EVT=0xf0,=>手机音频连接建立BT_HS_DISCONNECTED_EVT, =>手机音频连接断开BT_HS_RING_EVT, =>外部电话到来BT_HS_OK_EVT, =>蓝牙耳机端操作OKBT_DISCOVER_COMPLETE, =>蓝牙扫描完成事件 =>无intset_bt_name(constcharintset_dev_connectable(intinttimeintget_disc_results(char*disc_results,intint无int无int无int无int无int无#include<bluetooth_socket.h>#include<stdlib.h>#include<stdio.h>#include<unistd.h>#include<fcntl.h>#include<sys/stat.h>#defineDEBUG_MUSIC_INFO0staticintlast_status=0;staticintstatus=0;staticintplaying=0;c_btc;voidbt_event_f(BT_EVENTevent,void*reply,int{{case{printf("Mediaaudioconnected!\n");status=1;}case{printf("Mediaaudiodisconnected!\n");printf("linkdownreason%d\n",*(int*)reply);status=0;}case{printf("Mediastartplaying!\n");playing=1;}case{printf("Mediastopplaying!\n");playing=0;}}}intmain(intargc,*args[]){inttimes=0;intsave_fd=-1,fd=-1;inti=0;last_status=status=0;if(argc2){}else}/*connectedif((last_status==0)&&(status==last_status=1;}/*disconnectedif((last_status==1)&&(status==last_status=0;}if(playing1){c.avk_get_music_info(&music_info);printf("Title:%s\n",music_info.title);printf("Artist:%s\n",music_info.artist);}}}ThisdocumentistheoriginalworkandcopyrightedpropertyofAllwinnerTechnology(“Allwinner”).ReproductioninwholeorinpartmustobtainthewrittenapprovalofAllwinnerandgiveclearacknowledgmenttothecopyrightowner.TheinformationfurnishedbyAllwinnerisbelievedtobeaccurateandreliable.Allwinnerreservestherighttomakechangesincircuitdesignand/orspecificationsatanytimewithoutnotice.Allwinnerdoesnotassumeanyresponsibilityandliabilityforitsuse.Norforanyinfringementsofpatentsorotherrightsofthethirdpartieswhichmayresultfromitsuse.Nolicenseisgrantedbyimplicationorotherwiseunderanypatentorpate
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025技术咨询服务合同范本3
- 个人买房协议书
- 2025珠海市商业室内装饰装修合同范本
- 2025版机械设备购销合同范本
- 婚内酗酒协议书模板
- 2025年03月新疆吐鲁番市引进各类人才489人笔试历年典型考题(历年真题考点)解题思路附带答案详解
- Unit 11 Rules Matters 第三课时Developing the Topic(含答案)仁爱版2024七下英语日清限时练
- 2025年03月宿城区事业单位统一工作人员5人笔试历年典型考题(历年真题考点)解题思路附带答案详解
- 济宁职业技术学院《语言艺术与写作》2023-2024学年第二学期期末试卷
- 北京市朝阳区陈经伦中学2025年高三模拟考试(一)语文试题理试卷含解析
- 创新思维拓展-知到答案、智慧树答案
- 浙江宇翔职业技术学院单招职测参考试题库(含答案)
- 给小学生科普地质学知识
- 课程与教学评价课件
- 提高手卫生正确率品管圈课件
- 中医护理技术穴位贴敷
- 物业保盘行动策划方案
- 分布式光伏高处作业专项施工方案
- 《狼王梦》小学读后感400字
- 中国居民膳食指南(全)
- 水泥脱硝安全专篇
评论
0/150
提交评论