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

Documentation and example c code for USBButton #80

Open
AlexMcGopher opened this issue Apr 30, 2021 · 2 comments
Open

Documentation and example c code for USBButton #80

AlexMcGopher opened this issue Apr 30, 2021 · 2 comments

Comments

@AlexMcGopher
Copy link

Katie has added at issue "Support for USB button? #18" (closed)
#18
support for functionality like at the windows api functions:
USBButtonConfigurePermanent
USBButtonConfigureTemporary
USBButtonConfigureColor and
USBButtonGetState
#38

I was able to build the lib, but was not able to write the code for getting the state of the button or
configure it.
It would be a big help if there would be a short documentation about usage of usbbutton
regarding reading the buttons state and setting the buttons colour with a c programm using ultimarc lib.
and a small example program in c about how to use the lib functions of ultimarc.

Thanks and best regards :-) Alex

From issue #18: ( jupiispa commented on 30 Nov 2015)

Looking at the official Windows SDK, there are 3 parameters you can set in the USB button:
PACDRIVE_API BOOL __stdcall USBButtonConfigurePermanent(INT id, PBYTE data);
PACDRIVE_API BOOL __stdcall USBButtonConfigureTemporary(INT id, PBYTE data);
PACDRIVE_API BOOL __stdcall USBButtonConfigureColor(INT id, BYTE red, BYTE green, BYTE blue);
And one parameter that can be read:
PACDRIVE_API BOOL __stdcall USBButtonGetState(INT id, PBOOL state);

katie-snow commented on 3 Nov 2016
This hardware is now supported by pull request #38

@katie-snow
Copy link
Owner

To write to any of the boards with this library you will need to use the ulWriteToBoard or ulWriteToBoardFileStr, functions with extern in their declaration. There are validation functions to make sure you have the correct configuration. These are in ultimarc.h. You will need to generate a json object which matches the example configuration files in the umtool directory to be able to write with this library.

This library current and most likely won't have the read capability for any of the boards. The back end structure was not made with that in mind and would need a major rewrite.

I think I only support permanent configuration and color. I can't look at the complete documentation at the moment from Ultimarc to help me recall what all the options mean.

As for an example, the main.c in umtool directory is the example.

@AlexMcGopher
Copy link
Author

AlexMcGopher commented Jun 30, 2021

Thanks for your comment. Thats a pitty that I can't read the Info from the button if its pressed or not as at the win-api with USBButtonGetState...

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