Add changing user data QoS to pubsub
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
348e68e9df
commit
e016ef20e2
2 changed files with 10 additions and 2 deletions
|
@ -400,6 +400,7 @@ static void inapplicable_qos(dds_entity_kind_t qt, const char *n) {
|
||||||
#define get_qos_W(qt, q, n) ((qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
#define get_qos_W(qt, q, n) ((qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
||||||
#define get_qos_TW(qt, q, n) ((qt == DDS_KIND_TOPIC) || (qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
#define get_qos_TW(qt, q, n) ((qt == DDS_KIND_TOPIC) || (qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
||||||
#define get_qos_RW(qt, q, n) ((qt == DDS_KIND_READER) || (qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
#define get_qos_RW(qt, q, n) ((qt == DDS_KIND_READER) || (qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
||||||
|
#define get_qos_MRW(qt, q, n) ((qt == DDS_KIND_READER) || (qt == DDS_KIND_WRITER) || (qt == DDS_KIND_PARTICIPANT) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
||||||
#define get_qos_PS(qt, q, n) ((qt == DDS_KIND_PUBLISHER) || (qt == DDS_KIND_SUBSCRIBER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
#define get_qos_PS(qt, q, n) ((qt == DDS_KIND_PUBLISHER) || (qt == DDS_KIND_SUBSCRIBER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
||||||
#define get_qos_TRW(qt, q, n) ((qt == DDS_KIND_TOPIC) || (qt == DDS_KIND_READER) || (qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
#define get_qos_TRW(qt, q, n) ((qt == DDS_KIND_TOPIC) || (qt == DDS_KIND_READER) || (qt == DDS_KIND_WRITER) ? q : (inapplicable_qos((qt), n), (dds_qos_t*)0))
|
||||||
|
|
||||||
|
@ -563,7 +564,7 @@ static void *unescape(const char *str, size_t *len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void qos_user_data(dds_entity_kind_t qt, dds_qos_t *q, const char *arg) {
|
void qos_user_data(dds_entity_kind_t qt, dds_qos_t *q, const char *arg) {
|
||||||
dds_qos_t *qp = get_qos_RW(qt, q, "user_data");
|
dds_qos_t *qp = get_qos_MRW(qt, q, "user_data");
|
||||||
size_t len;
|
size_t len;
|
||||||
if (qp == NULL)
|
if (qp == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -567,7 +567,7 @@ static int read_value(char *command, int *key, struct tstamp_t *tstamp, char **a
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'p': case 'S': case ':': {
|
case 'p': case 'S': case ':': case 'Q': {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
*command = (char) c;
|
*command = (char) c;
|
||||||
while ((c = getc(stdin)) != EOF && !isspace((unsigned char) c)) {
|
while ((c = getc(stdin)) != EOF && !isspace((unsigned char) c)) {
|
||||||
|
@ -1424,6 +1424,13 @@ static char *pub_do_nonarb(const struct writerspec *spec, uint32_t *seq) {
|
||||||
dds_sleepfor(DDS_SECS(k));
|
dds_sleepfor(DDS_SECS(k));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'Q': {
|
||||||
|
dds_qos_t *qos = dds_create_qos ();
|
||||||
|
setqos_from_args (DDS_KIND_PARTICIPANT, qos, 1, (const char **) &arg);
|
||||||
|
dds_set_qos (dp, qos);
|
||||||
|
dds_delete_qos (qos);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'Y': case 'B': case 'E': case 'W':
|
case 'Y': case 'B': case 'E': case 'W':
|
||||||
non_data_operation(command, spec->wr);
|
non_data_operation(command, spec->wr);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue