Android Context Hub Runtime Environment backend. Main docs: https://pigweed.dev/pw_chre.
|
uint64_t | pw::chre::NanoappMessage::nano_app_id |
| The id of the nanoapp this message is sent to.
|
|
uint32_t | pw::chre::NanoappMessage::message_type |
| The type of message this is.
|
|
uint16_t | pw::chre::NanoappMessage::host_endpoint |
| The id of the host on the AP that sent this request.
|
|
const uint8_t * | pw::chre::NanoappMessage::data |
| The actual message data.
|
|
size_t | pw::chre::NanoappMessage::length |
| The size in bytes of the message data.
|
|
uint64_t | pw::chre::MessageToAp::nanoapp_id |
| The id of the nanoapp sending the message.
|
|
uint32_t | pw::chre::MessageToAp::message_type |
| The type of the message.
|
|
uint32_t | pw::chre::MessageToAp::app_permissions |
|
uint32_t | pw::chre::MessageToAp::message_permissions |
|
uint16_t | pw::chre::MessageToAp::host_endpoint |
| The id of the client that this message should be delivered to on the host.
|
|
bool | pw::chre::MessageToAp::woke_host |
|
const uint8_t * | pw::chre::MessageToAp::data |
|
size_t | pw::chre::MessageToAp::length |
| The length of data in bytes.
|
|
MessageToApContext | pw::chre::MessageToAp::chre_context |
|
◆ MessageToApContext
This is a token representing a message that CHRE allocated. It must be passed to FreeMessageToAp
when the message is finished.
◆ Deinit()
void pw::chre::Deinit |
( |
| ) |
|
Teardown the CHRE environment. This must be called after Init and after the event loop has been stopped.
◆ FreeMessageToAp()
Free a message that CHRE created to send to the AP (via SendMessageToAp
). This function must be called after the message is finishd being used. After this function is called, the message data must not be accessed. This can be called from any thread.
- Parameters
-
[in] | context | The message being freed. |
◆ Init()
Initialize the CHRE environment and load any static nanoapps that exist. This must be called before the event loop has been started.
◆ RunEventLoop()
void pw::chre::RunEventLoop |
( |
| ) |
|
Run the CHRE event loop. This function will not return until StopEventLoop
is called.
◆ SendMessageToAp()
CHRE calls this method to send a message to the Application Processor (AP). The client must implement this method, and the client is responsible for calling FreeMessageToAp
once they are finished with the message.
- Parameters
-
[in] | message | The message to be sent. |
[out] | bool | Whether this method was successful. |
◆ SendMessageToNanoapp()
Send a message to a nano app. This can be called from any thread.
- Parameters
-
[in] | message | The message being send to the nano app. |
◆ SetEstimatedHostTimeOffset()
void pw::chre::SetEstimatedHostTimeOffset |
( |
int64_t |
offset | ) |
|
Set the estimated offset between the AP time and CHRE's time.
- Parameters
-
[in] | offset | The offset time in nanoseconds. |
◆ StopEventLoop()
void pw::chre::StopEventLoop |
( |
| ) |
|
Stop the CHRE event loop. This can be called from any thread.
◆ chre_context
The context of the message, used to free the message when the client is finished sending it.
◆ data
const uint8_t* pw::chre::MessageToAp::data |
The underlying data of the message. This is owned by chre_context
and should not be accessed after the message has been freed.
◆ woke_host
bool pw::chre::MessageToAp::woke_host |
Whether CHRE is responsible for waking the AP. If this is true, then the client must wake the AP in SendMessageToAp
before sending this message.