1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-14 08:07:37 +01:00

Add API versioning scheme to aimeio

This commit is contained in:
Tau 2021-05-23 10:38:37 -04:00
parent 7fb846a839
commit 5e14b595ae
2 changed files with 27 additions and 1 deletions

View File

@ -162,6 +162,11 @@ static HRESULT aime_io_generate_felica(
return S_OK; return S_OK;
} }
uint16_t aime_io_get_api_version(void)
{
return 0x0100;
}
HRESULT aime_io_init(void) HRESULT aime_io_init(void)
{ {
aime_io_config_read(&aime_io_cfg, L".\\segatools.ini"); aime_io_config_read(&aime_io_cfg, L".\\segatools.ini");

View File

@ -5,9 +5,22 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/*
Get the version of the Aime IO API that this DLL supports. This function
should return a positive 16-bit integer, where the high byte is the major
version and the low byte is the minor version (as defined by the Semantic
Versioning standard).
The latest API version as of this writing is 0x0100.
*/
uint16_t aime_io_get_api_version(void);
/* /*
Initialize Aime IO provider DLL. Only called once, before any other Initialize Aime IO provider DLL. Only called once, before any other
functions exported from this DLL are called. functions exported from this DLL are called (except for
aime_io_get_api_version).
Minimum API version: 0x0100
*/ */
HRESULT aime_io_init(void); HRESULT aime_io_init(void);
@ -15,6 +28,8 @@ HRESULT aime_io_init(void);
Poll for IC cards in the vicinity. Poll for IC cards in the vicinity.
- unit_no: Always 0 as of the current API version - unit_no: Always 0 as of the current API version
Minimum API version: 0x0100
*/ */
HRESULT aime_io_nfc_poll(uint8_t unit_no); HRESULT aime_io_nfc_poll(uint8_t unit_no);
@ -30,6 +45,8 @@ HRESULT aime_io_nfc_poll(uint8_t unit_no);
- S_OK if a classic Aime is present and was read successfully - S_OK if a classic Aime is present and was read successfully
- S_FALSE if no classic Aime card is present (*luid will be ignored) - S_FALSE if no classic Aime card is present (*luid will be ignored)
- Any HRESULT error if an error occured. - Any HRESULT error if an error occured.
Minimum API version: 0x0100
*/ */
HRESULT aime_io_nfc_get_aime_id( HRESULT aime_io_nfc_get_aime_id(
uint8_t unit_no, uint8_t unit_no,
@ -54,6 +71,8 @@ HRESULT aime_io_nfc_get_aime_id(
- S_OK if a FeliCa device is present and was read successfully - S_OK if a FeliCa device is present and was read successfully
- S_FALSE if no FeliCa device is present (*IDm will be ignored) - S_FALSE if no FeliCa device is present (*IDm will be ignored)
- Any HRESULT error if an error occured. - Any HRESULT error if an error occured.
Minimum API version: 0x0100
*/ */
HRESULT aime_io_nfc_get_felica_id(uint8_t unit_no, uint64_t *IDm); HRESULT aime_io_nfc_get_felica_id(uint8_t unit_no, uint64_t *IDm);
@ -62,5 +81,7 @@ HRESULT aime_io_nfc_get_felica_id(uint8_t unit_no, uint64_t *IDm);
- unit_no: Always 0 as of the current API version - unit_no: Always 0 as of the current API version
- r, g, b: Primary color intensity, from 0 to 255 inclusive. - r, g, b: Primary color intensity, from 0 to 255 inclusive.
Minimum API version: 0x0100
*/ */
void aime_io_led_set_color(uint8_t unit_no, uint8_t r, uint8_t g, uint8_t b); void aime_io_led_set_color(uint8_t unit_no, uint8_t r, uint8_t g, uint8_t b);