@@ -114,6 +114,8 @@ struct orb_handle_s
114
114
* Pre-processor Definitions
115
115
****************************************************************************/
116
116
117
+ #define ORB_EVENT_FLUSH_COMPLETE SENSOR_EVENT_FLUSH_COMPLETE
118
+
117
119
#define ORB_SENSOR_PATH "/dev/uorb/"
118
120
#define ORB_USENSOR_PATH "/dev/usensor"
119
121
#define ORB_PATH_MAX (NAME_MAX + 16)
@@ -521,6 +523,23 @@ static inline int orb_copy(FAR const struct orb_metadata *meta,
521
523
522
524
int orb_get_state (int fd , FAR struct orb_state * state );
523
525
526
+ /****************************************************************************
527
+ * Name: orb_get_events
528
+ *
529
+ * Description:
530
+ * Get the events about the specify subscriber of topic.
531
+ *
532
+ * Input Parameters:
533
+ * fd The fd returned from orb_advertise / orb_subscribe.
534
+ * events Pointer to events, type is unsigned int pointer.
535
+ * eg: ORB_EVENT_FLUSH_COMPLETE
536
+ *
537
+ * Returned Value:
538
+ * -1 on error.
539
+ ****************************************************************************/
540
+
541
+ int orb_get_events (int fd , FAR unsigned int * events );
542
+
524
543
/****************************************************************************
525
544
* Name: orb_check
526
545
*
@@ -563,6 +582,27 @@ int orb_check(int fd, FAR bool *updated);
563
582
564
583
int orb_ioctl (int fd , int cmd , unsigned long arg );
565
584
585
+ /****************************************************************************
586
+ * Name: orb_flush
587
+ *
588
+ * Description:
589
+ * When topic data accumulates in the hardware buffer but does not reach
590
+ * the watermark, you can mmediately read the fifo data through the flush
591
+ * operation. You can call the flush operation at any time.
592
+ *
593
+ * After you call flush, you can determine whether the flush is completed
594
+ * by listening to the POLLPRI event of fd and getting the event in
595
+ * orb_get_events
596
+ *
597
+ * Input Parameters:
598
+ * fd A fd returned from orb_advertise / orb_subscribe.
599
+ *
600
+ * Returned Value:
601
+ * 0 on success.
602
+ ****************************************************************************/
603
+
604
+ int orb_flush (int fd );
605
+
566
606
/****************************************************************************
567
607
* Name: orb_set_batch_interval
568
608
*
0 commit comments