Developer World
Spresense SDK Library v3.2.0-ebc0364
sensor_message_types.h
1/****************************************************************************
2 * modules/include/sensing/sensor_message_types.h
3 *
4 * Copyright 2018 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
36#ifndef __INCLUDE_SENSING_SENSOR_MESSAGE_TYPES_H
37#define __INCLUDE_SENSING_SENSOR_MESSAGE_TYPES_H
38
40
41/************************************************************************
42 *
43 * request / response
44 *
45 ************************************************************************
46 */
47
48#define MSG_TYPE_SEN_RES (MSG_TYPE_RESPONSE | MSG_TYPE_USER_SENSOR_UTIL)
49#define MSG_TYPE_SEN_REQ (MSG_TYPE_REQUEST | MSG_TYPE_USER_SENSOR_UTIL)
50
51/************************************************************************
52 *
53 * category
54 *
55 ************************************************************************
56 */
57
58#define MSG_CAT_SEN_MNG (MSG_SET_CATEGORY(0x0))
59
60/************************************************************************
61 *
62 * MSG_CAT_SEN_MNG: Sensor Manager Command(bi-directional)
63 *
64 * D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
65 * +---+---+---+---+---+---+---+----+---+---+---+---+---+---+---+
66 * |REQ|USER_SENSOR| MSG_CAT_SEN_MNG| MSG_SUB_TYPE |
67 * +---+---+---+---+---+---+---+----+---+---+---+---+---+---+---+
68 *
69 ************************************************************************
70 */
71#define MSG_SENSOR_MNG_REQ (MSG_TYPE_SEN_REQ | MSG_CAT_SEN_MNG)
72#define MSG_SENSOR_MNG_RES (MSG_TYPE_SEN_RES | MSG_CAT_SEN_MNG)
73
74#define MSG_SENSOR_MGR_CMD_REGISTER_CLIENT (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x00))
75#define MSG_SENSOR_MGR_CMD_RELEASE_CLIENT (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x01))
76#define MSG_SENSOR_MGR_CMD_CHG_SUBSCRIPTION (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x02))
77#define MSG_SENSOR_MGR_CMD_SET_POWER (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x03))
78#define MSG_SENSOR_MGR_CMD_CLEAR_POWER (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x04))
79#define MSG_SENSOR_MGR_CMD_SEND_DATA (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x05))
80#define MSG_SENSOR_MGR_CMD_SEND_DATA_MH (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x06))
81#define MSG_SENSOR_MGR_CMD_SEND_RESULT (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x07))
82#define MSG_SENSOR_MGR_CMD_INVALID (MSG_SENSOR_MNG_REQ | MSG_SET_SUBTYPE(0x08))
83
84#define LAST_SENSOR_MNG_MSG (MSG_SENSOR_MGR_CMD_INVALID + 1)
85#define SENSOR_MNG_MSG_NUM (LAST_SENSOR_MNG_MSG & MSG_TYPE_SUBTYPE)
86
87#define MSG_SENSOR_MGR_RST (MSG_SENSOR_MNG_RES | MSG_SET_SUBTYPE(0x00))
88
89
90#endif /* __INCLUDE_SENSING_SENSOR_MESSAGE_TYPES_H */
Message Library API.