1 Star 0 Fork 0

delbertw/bno080-driver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
shtp.h 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
/*
* Copyright 2015-16 Hillcrest Laboratories, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License and
* any applicable agreements you may have with Hillcrest Laboratories, Inc.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Hillcrest Sensor Hub Transport Protocol (SHTP) API
*/
#ifndef SHTP_H
#define SHTP_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
// Advertisement TLV tags
#define TAG_NULL 0
#define TAG_GUID 1
#define TAG_MAX_CARGO_PLUS_HEADER_WRITE 2
#define TAG_MAX_CARGO_PLUS_HEADER_READ 3
#define TAG_MAX_TRANSFER_WRITE 4
#define TAG_MAX_TRANSFER_READ 5
#define TAG_NORMAL_CHANNEL 6
#define TAG_WAKE_CHANNEL 7
#define TAG_APP_NAME 8
#define TAG_CHANNEL_NAME 9
#define TAG_ADV_COUNT 10
#define TAG_APP_SPECIFIC 0x80
typedef void shtp_Callback_t(void * cookie, uint8_t *payload, uint16_t len, uint32_t timestamp);
typedef void shtp_AdvertCallback_t(void * cookie, uint8_t tag, uint8_t len, uint8_t *value);
typedef void shtp_SendCallback_t(void *cookie);
int shtp_init(void);
void shtp_start(bool dfu);
int shtp_listenChan(const char * app, const char * chan,
shtp_Callback_t *callback, void * cookie);
int shtp_listenAdvert(const char * appName,
shtp_AdvertCallback_t *advertCallback, void * cookie);
uint8_t shtp_chanNo(const char * appName, const char * chanName);
int shtp_send(uint8_t channel, uint8_t *payload, uint16_t len);
#ifdef __cplusplus
} // end of extern "C"
#endif
// #ifdef SHTP_H
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/delbertz/bno080-driver.git
git@gitee.com:delbertz/bno080-driver.git
delbertz
bno080-driver
bno080-driver
master

搜索帮助