Firmware
Classes | Public Member Functions | List of all members
px4muorb Interface Reference

Classes

class  KraitRpcWrapper
 

Public Member Functions

AEEResult orb_initialize ()
 interface method to start the uorb service and initialize the muorb
 
AEEResult set_absolute_time_offset (in long time_diff_us)
 Interface to set an offset to hrt_absolute_time on the DSP. More...
 
AEEResult get_absolute_time (rout unsigned long long time_us)
 Interface to request hrt_absolute_time on the DSP. More...
 
AEEResult param_update_to_shmem (in unsigned long param, in sequence< octet > value)
 Interface to update param for krait. More...
 
AEEResult param_update_index_from_shmem (rout sequence< octet > data)
 Interface to update index for krait. More...
 
AEEResult param_update_value_from_shmem (in unsigned long param, rout sequence< octet > value)
 Interface to get param value for krait. More...
 
AEEResult topic_advertised (in string topic_name)
 Interface called from krait to inform of a published topic. More...
 
AEEResult topic_unadvertised (in string topic_name)
 Interface called from krait to inform of a published topic. More...
 
AEEResult add_subscriber (in string topic_name)
 Interface to add a subscriber to the identified topic. More...
 
AEEResult remove_subscriber (in string topic_name)
 Interface to remove a subscriber for the identified topic. More...
 
AEEResult send_topic_data (in string topic_name, in sequence< octet > data)
 Interface called from krait for topic data. More...
 
AEEResult is_subscriber_present (in string topic_name, rout long status)
 Inteface to check if there are subscribers on the remote adsp client This inteface is required as the krait app can be restarted without adsp being re-started. More...
 
AEEResult receive_msg (rout long msg_type, rout string topic_name, rout sequence< octet > data, rout long bytes_returned)
 Interface to receive data from adsp. More...
 
AEEResult unblock_recieve_msg ()
 Since the receive_msg is a blocking call, the client will not be able to peform a clean shutdown. More...
 
AEEResult receive_bulk_data (rout sequence< octet > data, rout long bytes_returned, rout long topic_count)
 This interface will perform a bulk read from the adsp and return the data buffer. More...
 

Member Function Documentation

§ add_subscriber()

AEEResult px4muorb::add_subscriber ( in string  topic_name)

Interface to add a subscriber to the identified topic.

Parameters
topic_name
Returns
status 0 == success all others is a failure.

§ get_absolute_time()

AEEResult px4muorb::get_absolute_time ( rout unsigned long long  time_us)

Interface to request hrt_absolute_time on the DSP.

Parameters
time_uspointer to time in us

§ is_subscriber_present()

AEEResult px4muorb::is_subscriber_present ( in string  topic_name,
rout long  status 
)

Inteface to check if there are subscribers on the remote adsp client This inteface is required as the krait app can be restarted without adsp being re-started.

In this scenario the krait app does not know if there is subscriber on the remote end(ie adsp).

Parameters
topic_nameThe name of the topic for which the subscription needs to be checked.
routint status The status of the subscription, 0=no-subscribers, 1 = more than one subscriber.
Returns
status 0 == success all others is a failure.

§ param_update_index_from_shmem()

AEEResult px4muorb::param_update_index_from_shmem ( rout sequence< octet >  data)

Interface to update index for krait.

Parameters
dataparam index array.

§ param_update_to_shmem()

AEEResult px4muorb::param_update_to_shmem ( in unsigned long  param,
in sequence< octet >  value 
)

Interface to update param for krait.

Parameters
paramparam index.
valueparam value.

§ param_update_value_from_shmem()

AEEResult px4muorb::param_update_value_from_shmem ( in unsigned long  param,
rout sequence< octet >  value 
)

Interface to get param value for krait.

Parameters
paramparam index.
valueparam value.

§ receive_bulk_data()

AEEResult px4muorb::receive_bulk_data ( rout sequence< octet >  data,
rout long  bytes_returned,
rout long  topic_count 
)

This interface will perform a bulk read from the adsp and return the data buffer.

The structure of the messages is as follows +-------------—+--------—+------------—+-------—+-------------—+ | Topic Name Len | datal_len |TopicName(nullterminated) | data bytes | +-------------—+--------—+------------—+-------—+-------------—+ |<– 2 bytes –>|<-2bytes-> |<– topicnamelen bytes –>|<-datalenbytes->| +-------------—+------------------------—+-------—+-------------—+

Parameters
dataThe output buffer where the data needs to be copied
bytes_returnedThe number of bytes the buffer is filled up by.
topic_countThe numbe of topics filled in the buffer.
Returns
status 0 = success all others is a failure.

§ receive_msg()

AEEResult px4muorb::receive_msg ( rout long  msg_type,
rout string  topic_name,
rout sequence< octet >  data,
rout long  bytes_returned 
)

Interface to receive data from adsp.

Since there is only one interface, the different message types are identified by the msg_type field.

Parameters
msg_typeThe possible values are: 1 ==> add_subscriber 2 ==> remove_subscriber 3 ==> recieve_topic_data 4 ==> advertised_topic
Note
: for message types, 1 & 2, the data pointer returned is null with length of 0.
Parameters
topic_nameThe topic being returned.
datathe data stream
bytes_returnedThe number of bytes returned in the byte buffer.
Returns
status 0 == success all others is a failure.

§ remove_subscriber()

AEEResult px4muorb::remove_subscriber ( in string  topic_name)

Interface to remove a subscriber for the identified topic.

Parameters
topic_name
Returns
status 0 == success all others is a failure.

§ send_topic_data()

AEEResult px4muorb::send_topic_data ( in string  topic_name,
in sequence< octet >  data 
)

Interface called from krait for topic data.

Parameters
topic_name
dataa sequence of bytes for the passed data stream. as per the HExagon Documention, the max size of this stream is 255 bytes.
Returns
status 0 == success all others is a failure.

§ set_absolute_time_offset()

AEEResult px4muorb::set_absolute_time_offset ( in long  time_diff_us)

Interface to set an offset to hrt_absolute_time on the DSP.

Parameters
time_diff_ustime difference of the DSP clock to Linux clock. A positive number means the Linux clock is ahead of the DSP one.

§ topic_advertised()

AEEResult px4muorb::topic_advertised ( in string  topic_name)

Interface called from krait to inform of a published topic.

Parameters
topic_namename of the topic being advertised

§ topic_unadvertised()

AEEResult px4muorb::topic_unadvertised ( in string  topic_name)

Interface called from krait to inform of a published topic.

Parameters
topic_namename of the topic being advertised

§ unblock_recieve_msg()

AEEResult px4muorb::unblock_recieve_msg ( )

Since the receive_msg is a blocking call, the client will not be able to peform a clean shutdown.

Calling this function will unblock the receive msg an return an error code. Ideally this should be implemented as a timeout for the receive_msg call.

Parameters
none
Returns
status 0 = success all others is a failure.

The documentation for this interface was generated from the following file: