Global Function | Function Name |
---|---|
HMRState | HMRGetState() |
void | HMRInit(uint64_t appId) |
void | HMROpen(uint64_t uid, const char *region, const char *token, HMRCompletion completion) |
void | HMRClose() |
void | HMRRefreshToken(const char *token) |
void | HMRSetLogger(HMRLogFunction logFunction) |
void | HMRAddStateListener(HMRStateListener *listener) |
void | HMRRemoveStateListener(HMRStateListener *listener) |
const char * | HMRGetVersion() |
Function | Function Name |
---|---|
void | HMRCreateChatRoom(HMRCompletion completion) |
void | HMRCreateChatRoomWithInfo(HMRKvArray *info, HMRCompletion completion) |
void | HMRJoinChatRoom(uint64_t roomId, HMRCompletion completion) |
void | HMRJoinChatRoomWithMultiCheck(uint64_t roomId, bool isCheckMultiJoin, HMRCompletion completion) |
void | HMRJoinChatRoomWithConfigs(uint64_t roomId, const HMRKvItem *joinProps, int numerOfProperty, HMRCompletion completion) |
void | HMRLeaveChatRoom(uint64_t roomId, HMRCompletion completion) |
void | HMRChatRoomChangeBasicInfo:(uint64_t roomId, HMRCompletion completion) |
void | HMRChatRoomChangeBasicInfo(uint64_t roomId, HMRKvArray *info, HMRCompletion completion) |
void | HMRChatRoomFetchMembers(uint64_t roomId, int32_t num, int32_t offset, HMRCompletion completion) |
void | HMRChatRoomSetUserInfo(uint64_t roomId, HMRKvArray *infos, HMRCompletion completion) |
void | HMRChatRoomFetchOnLineUserInfoList(uint64_t roomId, HMRCompletion completion) |
void | HMRAddChatRoomListener(HMRChatRoomListener *listener) |
void | HMRRemoveChatRoomListener(HMRChatRoomListener *listener) |
void | HMRAddMemberListener(HMRChatRoomMemberListener *listener) |
void | HMRRemoveMemberListener(HMRChatRoomMemberListener *listener) |
HMRIdentity | HMRMakeChatRoomIdentity(uint64_t roomId) |
HMRCode | HMRExtractChatRoomId(HMRIdentity identity, uint64_t *roomId) |
bool | HMRIsChatRoom(HMRIdentity identity) |
HMRIdentity | HMRMakeChatRoomUser(uint64_t roomId, uint64_t userId) |
HMRCode | HMRExtractChatRoomUser(HMRIdentity identity, uint64_t *roomId, uint64_t *userId) |
bool | HMRIsChatRoomUser(HMRIdentity identity) |
Global Function | Function Name |
---|---|
void | HMRSendMessasge(HMRMessage *message, HMRCompletion completion) |
void | HMRAddMessageListener(HMRMessageListener *listener) |
void | HMRRemoveMessageListener(HMRMessageListener *listener) |
HMRMessage * | HMRCreateMessage(HMRIdentity receiver, HMRMessageContent content, HMRMessageExtra extra) |
void | HMRRetainMessage(HMRMessage *message) |
void | HMRReleaseMessage(HMRMessage *message) |
HMRMessageExtra | HMRMakeMessageExtra(const char *extra, int32_t length) |
bool | HMRIsMessageFailed(HMRMessage *message) |
HMRIdentity | HMRGetConversationTarget(HMRMessage *message) |
Get the SDK current status. See details in HMRState.
HMR_API void HMRInit(uint64_t appId);
Initialize a Hummer instance
Notes:
- Currently, the SDK only supports one Hummer instance and each application only creates one Hummer object.
- Unless otherwise specified, all API functions of Hummer are asynchronously called, and the API is called in the same thread.
- Regarding callback for all operations, unless otherwise specified, a HMRResult return of 0 indicates success, while any other value indicates failure. For specific error code meanings, see HMRCode.
Parameter | Description |
---|---|
appId | It is used to identify the specific service. See details in APPID. |
HMR_API void HMROpen(uint64_t uid, const char *region, const char *token, HMRCompletion completion);
Log in an SDK
Parameter | Description |
---|---|
uid | User ID |
region | Parameters of a region where a server is should be connected. Consult related SDK developers for details. |
token | A user token is required for service initialization |
completion | Callback of processing after completion |
HMR_API void HMRClose();
Log out an SDK
HMR_API void HMRRefreshToken(const char *token);
Refresh a user token
Parameter | Description |
---|---|
token | A user token to be refreshed |
HMR_API void HMRSetLogger(HMRLogFunction logFunction);
Set SDK log output managed callback
Notes:
- The service uses this method to set Logger, and the SDK will send log output and printing to the service for processing.
- The service needs to ensure the reporting of logs so that specific information can be found if and when problems later arise.
Parameter | Description |
---|---|
logFunction | Callback of SDK log output. See details in HMRLogFunction. |
HMR_API void HMRAddStateListener(HMRStateListener *listener);
Add an SDK state change listener
Parameter | Description |
---|---|
listener | A listener to be added. See details in HMRStateListener. |
HMR_API void HMRRemoveStateListener(HMRStateListener *listener);
Remove an SDK state change listener
Parameter | Description |
---|---|
listener | A listener to be removed. See details in HMRStateListener. |
HMR_API const char *HMRGetVersion();
Get SDK version information
HMR_API void HMRCreateChatRoom(HMRCompletion completion);
Create a chatroom
Notes:
- The chatroom must be created before it can be used, so you need to create a corresponding chatroom API.
- After a chatroom is created, the server will return a corresponding chatroom ID used for identifying the chatroom in the future.
- Chatroom information such as name, description, bulletin, and extension information, should be provided during chatroom creation.
- Default maximums:
The number of chatrooms created by one AppId: 100w
The number of members in one chatroom: 10w- A single user’s call frequency is limited to 10 times every 5 seconds.
Parameter | Description |
---|---|
completion | Callback after chatroom creation: If creation succeeds, the corresponding Chatroom ID will be returned to the service for subsequent chatroom operation; if creation fails, callback will also include the reason. |
HMR_API void HMRCreateChatRoomWithInfo(HMRKvArray *info, HMRCompletion completion);
Create a chatroom and configure chatroom information
Notes:
- The chatroom must be created before it can be used, so you need to create a corresponding chatroom API.
- After a chatroom is created, the server will return a corresponding chatroom ID used for identifying the chatroom in the future.
Parameter | Description |
---|---|
info | Chatroom information objects include name, description, announcement, and extension information. See details in HMRChatRoomBasicInfoType. |
completion | Callback after chatroom creation: If creation succeeds, the corresponding Chatroom ID will be returned to the service for subsequent chatroom operation; if creation fails, callback will also include the reason. |
HMR_API void HMRJoinChatRoom(uint64_t roomId, HMRCompletion completion);
Join a chatroom
Notes:
- You must join a chatroom before you can properly perform operations for that chatroom—for example, sending and receiving public screen or signaling messages.
- Joining a chatroom follows a logic of “multi-user mutual removal”. For details, consult the background configuration.
- A single user’s call frequency is limited to 10 times every 5 seconds.
Parameter | Description |
---|---|
roomId | Chatroom ID |
completion | Callback after joining a chatroom. The service can perform different operations according to joining results. If joining fails, callback will include the reason for error. |
HMR_API void HMRJoinChatRoomWithMultiCheck(uint64_t roomId, bool isCheckMultiJoin, HMRCompletion completion);
Join a chatroom and check for repeat login of current user
Notes:
- Currently the chatroom only supports single-end or multi-end access, so the specified access mode can search the background for corresponding configuration. Joining the chatroom via single-end access means that a second user joining the room will remove the first user from the room. If you have joined and now wish to exit the chatroom, call HMRLeaveChatRoom.
- You must join a chatroom before you can properly perform necessary operations—for example, sending and receiving public screen or signaling messages.
- A single user’s call frequency is limited to 10 times every 5 seconds.
Parameter | Description |
---|---|
roomId | Chatroom ID |
isCheckMultiJoin | Whether or not to check for repeat login |
completion | Callback after joining a chatroom. The service can perform different operations according to joining results. If joining fails, callback will include the reason for error. |
HMR_API void HMRJoinChatRoomWithConfigs(uint64_t roomId, const HMRKvItem *joinProps, int numerOfProperty, HMRCompletion completion);
Join a chatroom and specify extension information
Notes:
- Currently the chatroom only supports single-end or multi-end access, so the specified access mode can search the background for corresponding configuration. Joining the chatroom via single-end access means that a second user joining the room will remove the first user from the room. If you have joined and now wish to exit the chatroom, call HMRLeaveChatRoom.
- PYou must join a chatroom before you can properly perform necessary operations—for example, sending and receiving public screen or signaling messages..
- A single user’s call frequency is limited to 10 times every 5 seconds.
Parameter | Description |
---|---|
roomId | Chatroom ID |
joinProps | An extension field for service extension. The SDK is only responsible for pass-through. |
numerOfProperty | Number of extension fields |
completion | Callback after joining a chatroom. The service can perform different operations according to joining results. If joining fails, callback will include the reason for error. |
HMR_API void HMRLeaveChatRoom(uint64_t roomId, HMRCompletion completion);
Exit a chatroom
Notes:
- Once all the necessary logistics for joining the chatroom are processed, you can end interactions with the chatroom by exiting it. Listening to public screen or signaling messages and corresponding callback notifications will also be terminated.
Parameter | Description |
---|---|
roomId | Chatroom ID |
completion | Callback after exiting a chatroom. The service can perform different operations according to exiting results. If exiting fails, callback will include the reason for error. |
HMR_API void HMRChatRoomFetchBasicInfo(uint64_t roomId, HMRCompletion completion);
Get chatroom’s basic profile information
Notes:
- Getting chatroom information includes chatroom name, description, and bulletin, as well as corresponding extended field information.
- You can obtain chatroom information without joining the chatroom.
Parameter | Description |
---|---|
roomId | Chatroom ID |
completion | After callback, the service can perform different operations according to the callback result. Chatroom information is returned through the var parameter of (HMRKvArray*)(var.ptrValue) . See details in HMRKvArray. |
HMR_API void HMRChatRoomChangeBasicInfo(uint64_t roomId, HMRKvArray *info, HMRCompletion completion);
Change chatroom’s basic profile information
Notes:
- You can change chatroom information for one or more chatrooms according to your needs. Only the key-value pairs to be modified need to be specified in the parameters.
- A
Room Owner
orAdmin
role is required to change chatroom information.- A single user’s call frequency is limited to 10 times every 5 seconds.
Parameter | Description |
---|---|
roomId | Chatroom ID |
info | A changed profile value. See HMRChatRoomBasicInfoType for key enumeration values.. |
completion | Callback after change. The service can perform different operations according to the change results. |
HMR_API void HMRChatRoomFetchMembers(uint64_t roomId, int32_t num, int32_t offset, HMRCompletion completion);
Get a chatroom member list
Notes:
- In some scenarios, a single chatroom may have many thousands of members; therefore, this SDK provides corresponding paged member lists according to your requirements. Meanwhile, a corresponding member list is sorted according to certain default rules.
- You can use the API for retrieving the member list even without joining the chatroom.
- A single user’s call frequency is limited to 10 times every 5 seconds.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
offset | Specific page (the first page starts from 0) |
num | Set the number of members returned on each page (recommended no more than 200) |
completion | After callback, the service can perform different operations according to the result obtained, passing the member list through the var parameter of (HMRIdArray*)(var.ptrValue) by using the completion callback method. See details in HMRIdArray. |
HMR_API void HMRChatRoomSetUserInfo(uint64_t roomId, HMRKvArray *infos, HMRCompletion completion);
Set own user information
Notes:
- Maximum capacity:
set user profiles, the maximum number of supported attributes: 32
Maximum value for a single user profile: 8K.- A single user’s call frequency is limited to 10 times every 5 seconds.
Parameter | Description |
---|---|
roomId | Chatrooms that a member is in |
infos | User information. Support a maximum of 32 users. |
completion | Set callback for information return, with processing according to error codes |
HMR_API void HMRChatRoomFetchOnLineUserInfoList(uint64_t roomId, HMRCompletion completion);
Get a chatroom user information list
Notes:
- A maximum of 100 member lists can be returned; if over 100 lists are called for, 100 random lists are returned.
Parameter | Description |
---|---|
roomId | A chatroom to be searched |
completion | After callback, the service can perform different operations according to the resulting judgment. Chatroom user information is passed through the var parameter of (HMRChatRoomOnLineUserInfoList*)(var.ptrValue) . See details in HMRChatRoomOnLineUserInfoList. |
HMR_API void HMRAddChatRoomListener(HMRChatRoomListener *listener);
Add a chatroom callback listener
Parameter | Description |
---|---|
listener | A listener object. See details in HMRChatRoomListener. |
HMR_API void HMRRemoveChatRoomListener(HMRChatRoomListener *listener);
Remove a chatroom callback listener
Parameter | Description |
---|---|
listener | A listener object. See details in HMRChatRoomListener. |
HMR_API void HMRAddMemberListener(HMRChatRoomMemberListener *listener);
Add a chatroom member callback listener
Parameter | Description |
---|---|
listener | A listener object. See details in HMRChatRoomMemberListener. |
HMR_API void HMRRemoveMemberListener(HMRChatRoomMemberListener *listener);
Remove a chatroom member callback listener
Parameter | Description |
---|---|
listener | A listener object. See details in HMRChatRoomMemberListener. |
HMR_API HMRIdentity HMRMakeChatRoomIdentity(uint64_t roomId);
Create an identity object for a chatroom
Parameter | Description |
---|---|
roomId | Chatroom ID |
HMR_API HMRCode HMRExtractChatRoomId(HMRIdentity identity, uint64_t *roomId);
Extract chatroom ID from the chatroom's identity object
Parameter | Description |
---|---|
identity | Chatroom ID |
roomId | Resolved chatroom ID |
HMR_API bool HMRIsChatRoom(HMRIdentity identity);
Determine whether an identity object represents a chatroom
Parameter | Description |
---|---|
identity | Chatroom ID |
HMR_API HMRIdentity HMRMakeChatRoomUser(uint64_t roomId, uint64_t userId);
Create an identity object for a chatroom user
Parameter | Description |
---|---|
roomId | Chatroom ID |
userId | User ID |
HMR_API HMRCode HMRExtractChatRoomUser(HMRIdentity identity, uint64_t *roomId, uint64_t *userId);
Extract chatroom ID value from the chatroom Identity object
Parameter | Description |
---|---|
identity | Chatroom ID |
roomId | Parsed chatroom ID |
userId | Parsed user ID |
HMR_API bool HMRIsChatRoomUser(HMRIdentity identity);
Determine whether an identity object represents a chatroom user
Parameter | Description |
---|---|
identity | Chatroom ID |
HMR_API void HMRSendMessasge(HMRMessage *message, HMRCompletion completion);
A message sending API: supports sending a Public Screen Message (only supports text), Unicast or Broadcast Message.
Notes:
- This service can compose a message body by itself, filling in corresponding content and sending it out.
- This API also can resend the message in the case that the message sending fails.
- A single user’s call frequency limit:
For sending public screen messages: 10 times/5s
For sending a custom unicast message: 50 times/5s
For sending a custom broadcast message: 50 times/5s- Maximum capacity:
For a single unicast message: 2K
For a single broadcast message: 2K
Parameter | Description |
---|---|
message | Message instance. See details in HMRMessage. |
completion | Callback of sending operation completion |
There may be multiple stages/statuses in a message sending process, but The completion
only conducts final completion callback. Obtain the corresponding callback with HMRMessageListener.
HMR_API void HMRAddMessageListener(HMRMessageListener *listener);
Add a message sending/receiving listener
Parameter | Description |
---|---|
listener | A listener object to be added. If it has already been added, addListener will be an NOP. See details in HMRMessageListener. |
HMR_API void HMRRemoveMessageListener(HMRMessageListener *listener);
Remove a message sending/receiving listener
Parameter | Description |
---|---|
listener | A listener object to be removed. If the listener does not exist, nothing will happen. See details in HMRMessageListener. |
HMR_API HMRMessage *HMRCreateMessage(HMRIdentity receiver, HMRMessageContent content, HMRMessageExtra extra);
Create a message
Parameter | Description |
---|---|
receiver | Message receiver. See details in HMRIdentity. |
content | Message content. See details in HMRMessageContent. |
extra | Message extension content. See details in HMRMessageExtra. |
HMR_API void HMRRetainMessage(HMRMessage *message);
Retain a message’s reference
Parameter | Description |
---|---|
message | Message instance to be retained. See details in HMRMessage. |
HMR_API void HMRReleaseMessage(HMRMessage *message);
Release a message’s reference
Parameter | Description |
---|---|
message | Message instance to be retained. See details in HMRMessage. |
HMR_API HMRMessageExtra HMRMakeMessageExtra(const char *extra, int32_t length);
Create a message’s extension information
Parameter | Description |
---|---|
extra | Extension content |
length | Length of extension content |
HMR_API bool HMRIsMessageFailed(HMRMessage *message);
Determine a message’s failure status
Parameter | Description |
---|---|
message | Message instance. See details in HMRMessage. |
HMR_API HMRIdentity HMRGetConversationTarget(HMRMessage *message);
Get conversation target corresponding to the message object.
Parameter | Description |
---|---|
message | Message instance. See details in HMRMessage. |
enum HMRState
SDK current status
Enumeration Value | Description |
---|---|
HMRStateUnavailable(-1) | An unavailable status. The SDK is in this status while being not initialized. |
HMRStateClosed(0) | Closed |
HMRStateOpening(1) | Opening |
HMRStateOpened(2) | Opened |
typedef void(*HMRLogFunction)(const char *message);
Callback method pointer for log output
Parameter | Description |
---|---|
message | Log to be outputted |
struct HMRCompletion {
// Context object pointer for asynchronous request, which is generally the object pointer that initiates an asynchronous operation
void *context;
// ID of request passed in by service when constructing a completion. Uniqueness of the ID is guaranteed by service. Usually used to help service asynchronously request context mapping and recovery
uint64_t requestId;
// Function pointer for actually executed callback
HMROnComplete onComplete;
// Hummer Field reserved for internal use, not to be accessed or modified by service
void *reserved;
};
Asynchronous callback for requested operation
Member | Description |
---|---|
context | Context object pointer for asynchronous request |
requestId | Request ID automatically loaded upon service creation completion |
onComplete | Function pointer for actually executed callback |
reserved | Internal reserved field |
typedef void (*HMROnComplete)(void* context, uint64_t requestId, HMRResult result, HMRVariant var);
Function pointer for asynchronous operation callback
Parameter | Description |
---|---|
context | Context object pointer for asynchronous request |
requestId | Request ID automatically loaded upon service creation completion |
result | An asynchronous operation result object. It indicates operation success or failure and provides details on cause in the case of failure. |
var | A polymorphic simple data structure. Its value varies and has different meanings depending on different asynchronous APIs. |
struct HMRResult {
// Please refer to definitions in the error code table above
HMRCode code;
// Explanation of the readable text of the code. Its an ANSI code.
char msg[256];
};
Operation result
Parameter | Description |
---|---|
code | Error code |
msg | Explanation of a code’s readable text, is an ANSI code. |
union HMRVariant {
void *ptrValue;
char *stringValue;
uint32_t intValue;
uint64_t longValue;
};
A polymorphic simple data structure. Its value varies and has different meanings depending on different asynchronous APIs. To determine definition, refer to the corresponding API document.
Parameter | Description |
---|---|
ptrValue | Pointer data |
stringValue | String data |
intValue | Integer data |
longValue | Long integer data |
struct HMRKvItem {
const char* key;
const char* value;
};
Key-value pair information
struct HMRKvArray {
uint32_t len;
HMRKvItem *items;
};
Key-value pair array
struct HMRIdArray
{
uint32_t len;
uint64_t* ids;
};
ID array
struct HMRIdentity {
// string is used to store string representations of multiple ID types
// For example:
// User 1234: user_1234
// Chatroom 8876: chatroom_8876
// Construction and analysis of specific content should always use factory methods of the HMRMakeXXXIdentity series or the HMRExtractXXXId type instead of direct generation. For example: HMRMakeUserIdentity
char string[128];
};
Hummer internal entity ID
Parameter | Description |
---|---|
string | Entity ID |
static const char *HMRChatRoomBasicInfoTypeName = "Name";
static const char *HMRChatRoomBasicInfoTypeDescription = "Description";
static const char *HMRChatRoomBasicInfoTypeBulletin = "Bulletin";
static const char *HMRChatRoomBasicInfoTypeAppExtra = "AppExtra";
A basic chatroom information constant field: mainly used to modify and listen to chatroom information; it can identify which field is or needs to be changed.
Constant Value | Description |
---|---|
HMRChatRoomBasicInfoTypeName | Chatroom name |
HMRChatRoomBasicInfoTypeDescription | Chatroom description |
HMRChatRoomBasicInfoTypeBulletin | Chatroom announcement |
HMRChatRoomBasicInfoTypeExtention | Chatroom extension field (maximum 1K) |
struct HMRChatRoomOnLineUserInfo {
uint64_t uid;
HMRKvArray *info;
};
Online chatroom user information
Parameter | Description |
---|---|
[uid] | User ID |
[info] | User information. See details in HMRKvArray. |
struct HMRChatRoomOnLineUserInfoList {
uint32_t len;
HMRChatRoomOnLineUserInfo *users;
};
Online chatroom user information list
Parameter | Description |
---|---|
[len] | Number of users |
[users] | User information. See details in HMRChatRoomOnLineUserInfo. |
struct HMRUUID {
// Effective length is 36 bytes: 16 * 2 (bytes) + 4 (delimiters) + 1 (terminator), however, considering memory alignment, use 40 bytes
char string[40];
};
Unique message ID
Parameter | Description |
---|---|
string | Message ID |
const int32_t HMRMessageStateInit = 0;
const int32_t HRMMessageStateDelivering = 2;
const int32_t HMRMessageStateArchived = 3;
Constant Value | Description |
---|---|
HMRMessageStateInit(0) | Initialization state, under which messages can be sent. |
HRMMessageStateDelivering(2) | Sending, a state under which the current message cannot be sent or forwarded again. |
HMRMessageStateArchived(3) | Archiving state, which indicates that a message has been sent successfully or a message has been received from another end. The message can be sent or forwarded again. |
struct HMRMessage {
// if (state <= HMRMessageStateArchived && state> = 0)
// indicates a determined non-failure state, otherwise the state value should indicate sending is failed; the specific value is consistent with the HMRCode error code
int32_t state;
// unique message ID, which is usually generated by message sender and helps to de-duplicate and locate a message
HMRUUID uuid;
// message timestamp; for chatroom messages, the value is subject to local time. means it should not be used to
// strict message sorting, otherwise abnormal sorting may be resulted from malicious tampering
uint64_t timestamp;
// message sender ID, which is a User in most cases, or a type customized by service, such as system service official account
HMRIdentity sender;
// message receiving target ID; although message is received by the current device, it may be a group relationship message such as ChatRoom
HMRIdentity receiver;
// complete load of message content; during physical processing, load provided by different Content type should be used for
// dynamic judgment (such as HMRIsTextContent). Direct manual parsing and construction should be avoided unless it is a type expanded by service
HMRMessageContent content;
// every message may carry certain service pass-through information, in order to enable transmission of data such as “avatar/nickname of message sender”
// Reduce access pressure of business servers
HMRMessageExtra extra;
// Hummer Field reserved for internal use, not to be accessed or modified by service
void *reserved;
};
Message instances
Notes:
HMRMessage object resource management is implemented by reference counting. Therefore, the service itself manages the release of sent messages.
- To retain a message received by Hummer, call HMRRetainMessage to keep its reference.
- When you no longer need to use it, call HMRReleaseMessage to dereference the message.
Parameter | Description |
---|---|
state | Message status. See detail in HMRMessageState. |
uuid | Unique message ID. See detail in HMRUUID. |
timestamp | Message timestamp |
sender | Message sender ID. See detail in HMRIdentity. |
receiver | Message receiver ID. See detail in HMRIdentity. |
content | Message content. See detail in HMRMessageContent. |
extra | Message extension content. See details in HMRMessageExtra. |
reserved | SDK reserved field |
const int32_t HMRMessageContentSize = 2048;
struct HMRMessageContent {
char data[HMRMessageContentSize]; // Message content buffer
uint16_t availableSize; // Size of valid data in the buffer zone
};
Message content
Notes:
- Message content structure. Each message’s information is polymorphic—potentially composed of text, signaling, etc.
- As much as possible, use the creation and resolution methods of the content definition modules (ContentText or ContentSignal) rather than creating or resolving manually.
- Although data is a char array, it is not necessarily an ANSI string. More often than not, it is a string for storing UTF-8 codes, such as HMRTextContent.
- Exercise caution when determining the maximum message length to avoid access violation.
Parameter | Description |
---|---|
data | Content buffer zone |
availableSize | Valid data size in the buffer zone |
const int32_t HMRMessageExtraSize = 1024; // Size of buffer for data carried by message service
struct HMRMessageExtra {
// Extra data buffer
char data[HMRMessageExtraSize];
// Extra data valid bytes
uint16_t availableSize;
};
Definition of message extended content
Parameter | Description |
---|---|
data | Content buffer zone |
availableSize | Valid data size in the buffer zone |