Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is srv_id 0 zero? #404

Open
chadrockey opened this issue Jan 27, 2024 · 1 comment
Open

What is srv_id 0 zero? #404

chadrockey opened this issue Jan 27, 2024 · 1 comment

Comments

@chadrockey
Copy link
Contributor

Looks like all of our servers (peripherals) start with srv_id 1.

What is srv_id zero?

:param srv_id: integer between 0 & 9999 as unique reference

@ukBaz
Copy link
Owner

ukBaz commented Jan 27, 2024

Anything that is created and put on the D-Bus needs to have a unique that to identify it. The path of the service on the D-Bus needs to be made unique.
Which is done here by using the srv_id that is passed in to the peripheral.

self.path = self.PATH_BASE + str('{0:04d}'.format(service_id))

If all your paths are having 1 in them then I'm guessing that is because you are setting it to 1.
The value doesn't matter as long as different paths have different values. You can create random numbers if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants