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

Adjusting public methods arguments to support JSON-RPC #92

Open
DerAndereAndi opened this issue Jul 10, 2024 · 1 comment
Open

Adjusting public methods arguments to support JSON-RPC #92

DerAndereAndi opened this issue Jul 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@DerAndereAndi
Copy link
Member

Right now the public methods arguments require an argument entity spineapi.EntityRemoteInterface to specify which entity of which remote device is meant. This can not be used / represented via JSON.

To make this work, the idea would be to use an SPINE model.EntityAddressType similar data type. The SPINE data definition is:

type EntityAddressType struct {
	Device *AddressDeviceType  `json:"device,omitempty"`
	Entity []AddressEntityType `json:"entity,omitempty"`
}

A compatible and easier to use data type would be:

type EntityAddressType struct {
	Device string
	Entity []uint
}

This can be easily represented in JSON and also used to get the corresponding entity spineapi.EntityRemoteInterface which is needed to invoke the functions. The data structure can also be easily created in the callback functions from an entity spineapi.EntityRemoteInterface data type using a generic helper method.

@DerAndereAndi DerAndereAndi added the enhancement New feature or request label Jul 10, 2024
@DerAndereAndi
Copy link
Member Author

This wouldn't be enough, as each exported method needs to have a second pointer variable for the response. Which in turn would change how everything works.

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

No branches or pull requests

1 participant