px4muorb.idl
7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
//=======================================================================
// Copyright (c) 2016, Mark Charlebois. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of The Linux Foundation nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//=========================================================================
#include "AEEStdDef.idl"
interface px4muorb{
/**
* interface method to start the uorb service and initialize the muorb
*/
AEEResult orb_initialize();
/**
* Interface to set an offset to hrt_absolute_time on the DSP.
*
* @param time_diff_us: time difference of the DSP clock to Linux clock.
* A positive number means the Linux clock is ahead of the DSP one.
*/
AEEResult set_absolute_time_offset( in long time_diff_us );
/**
* Interface to request hrt_absolute_time on the DSP.
* @param time_us: pointer to time in us
*/
AEEResult get_absolute_time(rout unsigned long long time_us);
/**
* Interface to update param for krait.
*
* @param param: param index.
* @param value: param value.
*/
AEEResult param_update_to_shmem( in unsigned long param, in sequence<octet> value);
/**
* Interface to update index for krait.
* @param data: param index array.
*/
AEEResult param_update_index_from_shmem( rout sequence<octet> data);
/**
* Interface to get param value for krait.
*
* @param param: param index.
* @param value: param value.
*/
AEEResult param_update_value_from_shmem( in unsigned long param, rout sequence<octet> value);
/**
* Interface called from krait to inform of a published topic.
* @param topic_name: name of the topic being advertised
*/
AEEResult topic_advertised(in string topic_name);
/**
* Interface called from krait to inform of a published topic.
* @param topic_name: name of the topic being advertised
*/
AEEResult topic_unadvertised(in string topic_name);
/**
* Interface to add a subscriber to the identified topic
* @param topic_name
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult add_subscriber( in string topic_name );
/**
* Interface to remove a subscriber for the identified topic.
* @param topic_name
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult remove_subscriber( in string topic_name );
/**
* Interface called from krait for topic data.
* @param topic_name
* @param data
* a sequence of bytes for the passed data stream.
* as per the HExagon Documention, the max size of this stream is 255 bytes.
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult send_topic_data( in string topic_name, in sequence<octet> data );
/**
* 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).
* @param topic_name
* The name of the topic for which the subscription needs to be checked.
* @param rout int status
* The status of the subscription, 0=no-subscribers, 1 = more than one subscriber.
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult is_subscriber_present( in string topic_name, rout long status );
/**
* Interface to receive data from adsp. Since there is only one interface, the different message
* types are identified by the msg_type field.
* @param msg_type
* The 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.
* @param topic_name
* The topic being returned.
* @param data
* the data stream
* @param bytes_returned
* The number of bytes returned in the byte buffer.
* @return status
* 0 == success
* all others is a failure.
*/
AEEResult receive_msg( rout long msg_type, rout string topic_name, rout sequence<octet> data, rout long bytes_returned );
/**
* 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.
* @param none
* @return status
* 0 = success
* all others is a failure.
**/
AEEResult unblock_recieve_msg();
/**
* 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->|
* +----------------+---------------------------+----------+----------------+
* @param data
* The output buffer where the data needs to be copied
* @param bytes_returned
* The number of bytes the buffer is filled up by.
* @param topic_count
* The numbe of topics filled in the buffer.
* @return status
* 0 = success
* all others is a failure.
**/
AEEResult receive_bulk_data( rout sequence<octet> data, rout long bytes_returned, rout long topic_count );
};