38 #include <px4_platform_common/tasks.h> 39 #include <px4_platform_common/posix.h> 40 #include <dspal_platform.h> 44 #include <px4_platform_common/shmem.h> 45 #include <px4_platform_common/log.h> 53 HAP_power_request(100, 100, 1000);
63 const char *argv[] = {
"dspal",
"start" };
73 return hrt_set_absolute_time_offset(time_diff_us);
84 int data_len_in_bytes)
86 unsigned int byte_changed, bit_changed;
93 if (get_shmem_lock(__FILE__, __LINE__) != 0) {
94 PX4_INFO(
"Could not get shmem lock\n");
100 byte_changed = param / 8;
101 bit_changed = 1 << param % 8;
102 shmem_info_p->krait_changed_index[byte_changed] |= bit_changed;
104 release_shmem_lock(__FILE__, __LINE__);
115 if (get_shmem_lock(__FILE__, __LINE__) != 0) {
116 PX4_INFO(
"Could not get shmem lock\n");
120 for (
int i = 0;
i < data_len_in_bytes;
i++) {
121 data[
i] = shmem_info_p->adsp_changed_index[
i];
124 release_shmem_lock(__FILE__, __LINE__);
130 int data_len_in_bytes)
132 unsigned int byte_changed, bit_changed;
139 if (get_shmem_lock(__FILE__, __LINE__) != 0) {
140 PX4_INFO(
"Could not get shmem lock\n");
144 *param_value = shmem_info_p->params_val[param];
147 byte_changed = param / 8;
148 bit_changed = 1 << param % 8;
149 shmem_info_p->adsp_changed_index[byte_changed] &= ~bit_changed;
151 release_shmem_lock(__FILE__, __LINE__);
159 PX4_INFO(
"TEST px4muorb_topic_advertised of [%s] on remote side...", topic_name);
163 if (rxHandler !=
nullptr) {
176 PX4_INFO(
"TEST px4muorb_topic_unadvertised of [%s] on remote side...", topic_name);
180 if (rxHandler !=
nullptr) {
197 if (rxHandler !=
nullptr) {
218 if (rxHandler !=
nullptr) {
229 int data_len_in_bytes)
235 if (rxHandler !=
nullptr) {
249 int32_t local_status = 0;
254 *status = (int) local_status;
261 uint8_t *
data,
int data_len_in_bytes,
int *bytes_returned)
264 int32_t local_msg_type = 0;
265 int32_t local_bytes_returned = 0;
268 rc = channel->
get_data(&local_msg_type, topic_name, topic_name_len, data,
269 data_len_in_bytes, &local_bytes_returned);
270 *msg_type = (int) local_msg_type;
271 *bytes_returned = (int) local_bytes_returned;
276 int max_size_in_bytes,
int *returned_length_in_bytes,
int *topic_count)
279 int32_t local_bytes_returned = 0;
280 int32_t local_topic_count = 0;
283 rc = channel->
get_bulk_data(bulk_transfer_buffer, max_size_in_bytes,
284 &local_bytes_returned, &local_topic_count);
285 *returned_length_in_bytes = (int) local_bytes_returned;
286 *topic_count = (int) local_topic_count;
uORBCommunicator::IChannelRxHandler * GetRxHandler()
static uORB::Manager * get_instance()
Method to get the singleton instance for the uORB::Manager.
static struct vehicle_status_s status
int px4muorb_add_subscriber(const char *name)
API for the uORB lightweight object broker.
int px4muorb_receive_bulk_data(uint8_t *bulk_transfer_buffer, int max_size_in_bytes, int *returned_length_in_bytes, int *topic_count)
int px4muorb_topic_advertised(const char *topic_name)
static bool initialize()
Initialize the singleton.
virtual int16_t process_remove_subscription(const char *messageName)=0
Interface to process a received control msg to remove subscription.
void AddRemoteSubscriber(const std::string &messageName)
static uORB::FastRpcChannel * GetInstance()
static method to get the IChannel Implementor.
virtual int16_t process_remote_topic(const char *topic_name, bool isAdvertisement)=0
Interface to process a received topic from remote.
Global flash based parameter store.
int px4muorb_is_subscriber_present(const char *topic_name, int *status)
virtual int16_t process_add_subscription(const char *messageName, int32_t msgRateInHz)=0
Interface to process a received AddSubscription from remote.
virtual int16_t process_received_message(const char *messageName, int32_t length, uint8_t *data)=0
Interface to process the received data message.
int px4muorb_get_absolute_time(uint64_t *time_us)
void RemoveRemoteSubscriber(const std::string &messageName)
int px4muorb_topic_unadvertised(const char *topic_name)
__END_DECLS int px4muorb_orb_initialize()
int px4muorb_unblock_recieve_msg(void)
int16_t is_subscriber_present(const char *messageName, int32_t *status)
int16_t get_bulk_data(uint8_t *buffer, int32_t max_size_in_bytes, int32_t *returned_bytes, int32_t *topic_count)
Class passed to the communication link implement to provide callback for received messages over a cha...
int px4muorb_send_topic_data(const char *name, const uint8_t *data, int data_len_in_bytes)
int px4muorb_remove_subscriber(const char *name)
int px4muorb_set_absolute_time_offset(int32_t time_diff_us)
int px4muorb_param_update_index_from_shmem(unsigned char *data, int data_len_in_bytes)
int px4muorb_receive_msg(int *msg_type, char *topic_name, int topic_name_len, uint8_t *data, int data_len_in_bytes, int *bytes_returned)
__BEGIN_DECLS int dspal_main(int argc, char *argv[])
int16_t unblock_get_data_method()
int16_t get_data(int32_t *msg_type, char *topic_name, int32_t topic_name_len, uint8_t *data, int32_t data_len_in_bytes, int32_t *bytes_returned)
int px4muorb_param_update_to_shmem(uint32_t param, const uint8_t *value, int data_len_in_bytes)
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
int px4muorb_param_update_value_from_shmem(uint32_t param, const uint8_t *value, int data_len_in_bytes)