Skip to content

Implementing an ANT+ server #18

@cleeland

Description

@cleeland

Hi,

I'm working on implementing the ANT+ FE-C profile which requires not only being a client (receiving and reacting) but also being a server (sending messages). I originally started working with a downstream fork from David Hari but noticed that you'd implemented most of the event framework, so I've ended up here.

What's not clear is how I can use that framework to EMIT data messages. I haven't looked at all of the profiles, but it seems that at least for the FE-C, the profile requires that data be sent every 250ms. So I was thinking of defining a callback, e.g., 'onSlotTimeout', which would get called when the slot interval expired. That would probably require plumbing down into the guts of the EventPump. I would make the interval configurable, and at least for now only one interval callback duration would be allowed.

I also need to integrate this to control another device via serial port. Originally I was going to have a single event loop servicing both devices, but I don't think that strategy will work well for this framework as-is, because python-ant owns its own event loop. I could run the stuff for the other device in a different thread, but that would require synchronization of data between the two threads. Maybe not the worst thing, but managing everything in one thread is certainly simpler and less error-prone. Any suggestions you might have in this regard would be appreciated.

I'm curious about the "extended_messages" branch that appears to be dormant. It looks like it contains some server-side code and some sort of higher-level event framework. From the name I suspect the branch implements ANT+ extended messages, but it looks like there's other useful stuff in there as well. Can you give me any information on it? Does it work? Why was it abandoned?

Any insights you might have appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions