an old afLib which supports both SPI and UART
msg_types.h@1:112741fe45d1, 2018-04-23 (annotated)
- Committer:
- Rhyme
- Date:
- Mon Apr 23 06:15:05 2018 +0000
- Revision:
- 1:112741fe45d1
- Parent:
- 0:6f371c791202
afLib1.3 first mbed version with working UART
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Rhyme | 0:6f371c791202 | 1 | /** |
| Rhyme | 0:6f371c791202 | 2 | * Copyright 2015 Afero, Inc. |
| Rhyme | 0:6f371c791202 | 3 | * |
| Rhyme | 0:6f371c791202 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| Rhyme | 0:6f371c791202 | 5 | * you may not use this file except in compliance with the License. |
| Rhyme | 0:6f371c791202 | 6 | * You may obtain a copy of the License at |
| Rhyme | 0:6f371c791202 | 7 | * |
| Rhyme | 0:6f371c791202 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| Rhyme | 0:6f371c791202 | 9 | * |
| Rhyme | 0:6f371c791202 | 10 | * Unless required by applicable law or agreed to in writing, software |
| Rhyme | 0:6f371c791202 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| Rhyme | 0:6f371c791202 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| Rhyme | 0:6f371c791202 | 13 | * See the License for the specific language governing permissions and |
| Rhyme | 0:6f371c791202 | 14 | * limitations under the License. |
| Rhyme | 0:6f371c791202 | 15 | */ |
| Rhyme | 0:6f371c791202 | 16 | |
| Rhyme | 0:6f371c791202 | 17 | #ifndef MSG_TYPE_H__ |
| Rhyme | 0:6f371c791202 | 18 | #define MSG_TYPE_H__ |
| Rhyme | 0:6f371c791202 | 19 | |
| Rhyme | 0:6f371c791202 | 20 | typedef uint8_t msg_type_t; |
| Rhyme | 0:6f371c791202 | 21 | |
| Rhyme | 0:6f371c791202 | 22 | #define SYNC_REQUEST 0x30 |
| Rhyme | 0:6f371c791202 | 23 | #define SYNC_ACK 0x31 |
| Rhyme | 0:6f371c791202 | 24 | |
| Rhyme | 0:6f371c791202 | 25 | #define MSG_TYPE_UNKNOWN 0 |
| Rhyme | 0:6f371c791202 | 26 | #define MSG_TYPE_ERROR 1 |
| Rhyme | 0:6f371c791202 | 27 | |
| Rhyme | 0:6f371c791202 | 28 | // Messaging channel messages |
| Rhyme | 0:6f371c791202 | 29 | #define MESSAGE_CHANNEL_BASE 10 |
| Rhyme | 0:6f371c791202 | 30 | #define MSG_TYPE_SET (MESSAGE_CHANNEL_BASE + 1) |
| Rhyme | 0:6f371c791202 | 31 | #define MSG_TYPE_GET (MESSAGE_CHANNEL_BASE + 2) |
| Rhyme | 0:6f371c791202 | 32 | #define MSG_TYPE_UPDATE (MESSAGE_CHANNEL_BASE + 3) |
| Rhyme | 0:6f371c791202 | 33 | |
| Rhyme | 0:6f371c791202 | 34 | #define NEGOTIATOR_CHANNEL_BASE 20 |
| Rhyme | 0:6f371c791202 | 35 | #define MSG_TYPE_AUTHENTICATOR_SESSION_INFO (NEGOTIATOR_CHANNEL_BASE + 1) |
| Rhyme | 0:6f371c791202 | 36 | #define MSG_TYPE_PERIPHERAL_SESSION_INFO (NEGOTIATOR_CHANNEL_BASE + 2) |
| Rhyme | 0:6f371c791202 | 37 | #define MSG_TYPE_SIGNED_SESSION_PUBLIC_KEYS (NEGOTIATOR_CHANNEL_BASE + 3) |
| Rhyme | 0:6f371c791202 | 38 | #define MSG_TYPE_MESSAGING_AVAILABLE (NEGOTIATOR_CHANNEL_BASE + 4) |
| Rhyme | 0:6f371c791202 | 39 | #define MSG_TYPE_PAIRING_COMPLETE (NEGOTIATOR_CHANNEL_BASE + 5) |
| Rhyme | 0:6f371c791202 | 40 | |
| Rhyme | 0:6f371c791202 | 41 | // Success states |
| Rhyme | 0:6f371c791202 | 42 | #define UPDATE_STATE_UPDATED 0 |
| Rhyme | 0:6f371c791202 | 43 | |
| Rhyme | 0:6f371c791202 | 44 | // Failure states |
| Rhyme | 0:6f371c791202 | 45 | #define UPDATE_STATE_INTERRUPTED 1 |
| Rhyme | 0:6f371c791202 | 46 | #define UPDATE_STATE_UNKNOWN_UUID 2 |
| Rhyme | 0:6f371c791202 | 47 | #define UPDATE_STATE_LENGTH_EXCEEDED 3 |
| Rhyme | 0:6f371c791202 | 48 | #define UPDATE_STATE_CONFLICT 4 |
| Rhyme | 0:6f371c791202 | 49 | #define UPDATE_STATE_FAILED 5 |
| Rhyme | 0:6f371c791202 | 50 | |
| Rhyme | 0:6f371c791202 | 51 | #define UPDATE_REASON_UNKNOWN 0x00 |
| Rhyme | 0:6f371c791202 | 52 | #define UPDATE_REASON_LOCAL_OR_MCU_UPDATE 0x01 // local or unsolicited UPDATE from MCU |
| Rhyme | 0:6f371c791202 | 53 | #define UPDATE_REASON_SERVICE_SET 0x02 // response to Service SET |
| Rhyme | 0:6f371c791202 | 54 | #define UPDATE_REASON_MCU_SET 0x03 // response to MCU SET |
| Rhyme | 0:6f371c791202 | 55 | #define UPDATE_REASON_RELINK 0x04 |
| Rhyme | 0:6f371c791202 | 56 | #define UPDATE_REASON_BIND_FOLLOW 0x05 // a bound attribute was changed |
| Rhyme | 0:6f371c791202 | 57 | #define UPDATE_REASON_FAKE_UPDATE 0x06 // fake update launched |
| Rhyme | 0:6f371c791202 | 58 | #define UPDATE_REASON_NOTIFY_MCU_WE_REBOOTED 0x07 // notify MCU we rebooted. Never goes to Service |
| Rhyme | 0:6f371c791202 | 59 | #define UPDATE_REASON_LOCAL_SET 0x08 // response to Local SET |
| Rhyme | 0:6f371c791202 | 60 | #define UPDATE_REASON_INTERNAL_LAST_VALID UPDATE_REASON_LOCAL_SET // always last valid #define |
| Rhyme | 0:6f371c791202 | 61 | #define UPDATE_REASON_INTERNAL_SET_FAIL 0xfe // Set failed |
| Rhyme | 0:6f371c791202 | 62 | #define UPDATE_REASON_INTERNAL_NO_CHANGE 0xff // do not change current value (not to be sent to Service) |
| Rhyme | 0:6f371c791202 | 63 | |
| Rhyme | 0:6f371c791202 | 64 | #endif // MSG_TYPE_H__ |
| Rhyme | 0:6f371c791202 | 65 |