| // Copyright 2023 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.bluetooth.map; |
| |
| // Based on MAP v1.4.2 section 3.1.6. |
| const MAX_SUBJECT_LENGTH uint16 = 256; |
| const MAX_SENDER_ADDR_LENGTH uint16 = 256; |
| const MAX_SENDER_NAME_LENGTH uint16 = 256; |
| const MAX_FOLDER_LENGTH uint16 = 512; |
| const CONVERSATION_ID_LENGTH uint8 = 16; |
| |
| /// Based on x-bt/message, x-bt/MAP-msg-listing v1.1, and MAP-Event-Report NewMessage objects. |
| /// See MAP v1.4.2 sections 3.1.3 and 3.1.6 for details. |
| /// Depending on the method used to get the message, not all fields |
| /// may be populated. |
| type Message = table { |
| /// Handle for this message. Locally unique to each |
| /// Message Server Equipment (MSE). |
| /// Always present. |
| 1: handle uint64; |
| /// Summary of the message. |
| 2: subject string:MAX_SUBJECT_LENGTH; |
| /// Unix timestamp that represents the sending time if it was included |
| /// in the message, otherwise represents the reception time of the MSE. |
| 3: timestamp int64; |
| /// Information about the sender. |
| 4: sender Audience; |
| /// Information about the recipient. |
| 5: recipient Audience; |
| /// Type of the message. |
| /// Always present. |
| 6: type MessageType; |
| /// Content of the message. |
| 7: content string:MAX; |
| /// Folder where the message is located in. |
| 8: folder string:MAX_FOLDER_LENGTH; |
| /// Whether or not message is high priority. |
| /// If this information is missing, it would be set as unknown, not false. |
| 9: priority bool; |
| /// Whether or not message was read. |
| /// If this information is missing, it would be set as unknown, not false. |
| 10: read bool; |
| /// Whether or not meessage has already been sent to the recipient. |
| /// If this information is missing, it would be set as unknown, not false. |
| 11: sent bool; |
| /// Whether or not message is protected by a DRM scheme. |
| 12: protected bool; |
| /// A 128 bit value that uniquely identifies a conversation within a single MAS instance. |
| 13: conversation_id array<uint8, CONVERSATION_ID_LENGTH>; |
| }; |
| |
| type Audience = table { |
| /// Addressing information. In the case of emails, it's email address. |
| /// In the case of an email, this is the sender's email address. |
| /// In the case of an SMS, this is the sender's phone number. |
| /// In the case of an MMS, this is the senders email address or phone number. |
| 1: addressing string:MAX_SENDER_ADDR_LENGTH; |
| /// Display friendly name. |
| 2: name string:MAX_SENDER_NAME_LENGTH; |
| }; |
| |
| /// Used to represent the type of a particular Message. |
| /// Also used to present the message types that are supported |
| /// by a Message Access Server. |
| type MessageType = strict bits : uint8 { |
| EMAIL = 0x01; |
| SMS_GSM = 0x02; |
| SMS_CDMA = 0x04; |
| MMS = 0x08; |
| IM = 0x10; |
| }; |
| |
| /// Specific error that is returned for Message Access/Message Notification |
| /// related requests. |
| type Error = strict enum { |
| /// A general error occurred that cannot be classified as one of the more specific statuses. |
| GENERIC = 1; |
| |
| /// Peer was disconnected. |
| PEER_DISCONNECTED = 2; |
| |
| /// Requested object or entity was not found. |
| NOT_FOUND = 3; |
| |
| /// Request was not recognized/ill-formatted or contained parameters that |
| /// were not acceptable to the peer. |
| BAD_REQUEST = 4; |
| |
| /// Request was not implemented at the peer. |
| NOT_IMPLEMENTED = 5; |
| |
| /// Object to be handled was protected and access was not authorized. |
| UNAUTHORIZED = 6; |
| |
| /// Request could not be performed due to some condition at the peer. |
| UNAVAILABLE = 7; |
| }; |