skysafe / gr-sigmf

GNURadio blocks to read, write, and modify SigMF datasets
Other
30 stars 11 forks source link

What should the message api look like for the sink block? #4

Closed pwicks86 closed 6 years ago

pwicks86 commented 6 years ago

It seems like it would be nice if the sink block could create new metadata based on received messages. What should the api surface for this look like? Should it be via a separate port? Should there also be corresponding methods to add metadata? Does it make sense to do both capture and annotation segments this way?

storborg commented 6 years ago

I think it should be possible to add annotations via either stream tags or messages, but for global metadata it doesn't seem like you'd ever want to use a stream tag. It might be practical to just have a single message port: if a message is received with a timestamp or sample offset, it's an annotation, otherwise, it's a global metadata key/value pair.

pwicks86 commented 6 years ago

How about this:

{
    'cmd': 'set_annotation_meta',
    'sample_start': 23423,
    'sample_count': 1000,
    'key': 'core:comment',
    'val': 'This is some interesting data'
}

The only other question then is whether it makes sense to have any api to create new capture segments apart from stream tags.

pwicks86 commented 6 years ago

Made a PR with my proposed changes for review, see #5

pwicks86 commented 6 years ago

Closed via #5