microsoft / jacdac

Device and service catalogs for Jacdac.
https://aka.ms/jacdac
Creative Commons Attribution 4.0 International
66 stars 25 forks source link

how to add a new service #1167

Closed tballmsft closed 2 years ago

tballmsft commented 2 years ago

Need a page describing how to create new service

Design service

  1. make sure there's no existing service that meets your needs.
  2. design/spec service. is this a top-level new service or a mixin service for an existing service?
  3. create service specification (jacdac/services/.md)
    • tool for this

Implement service

  1. start with a copy of existing service
  2. run tool to generate header file .h
  3. create new file .c in microsoft/jacdac-c/services
tballmsft commented 2 years ago

@mmoskal - can you check the above steps?

mmoskal commented 2 years ago

Maybe split into creating a service and then adding impl?

pelikhan commented 2 years ago

We have a service editor that generates a PR, but I can see how this does not fit into the cycle of someone writing a new c server.

Might be confusing.

tballmsft commented 2 years ago

@mmoskal and @pelikhan, please see https://microsoft.github.io/jacdac-docs/ddk/services/ and edit.

pelikhan commented 2 years ago

The preferred flow: use service-editor, submit pull request, PR merged, implement firmware, while we add sim support.

tballmsft commented 2 years ago

You still need to understand where to start - look at existing services. And you also need to see whether a mixin or new top-level services is needed. It's basically the same flow as what you have.

tballmsft commented 2 years ago

@mmoskal ?

mmoskal commented 2 years ago

Edited the text a little

added issue https://github.com/microsoft/jacdac/issues/1173