Implement NFC::GetTagState

This commit is contained in:
wheremyfoodat 2023-08-18 17:42:05 +03:00
parent ceb3f05c7e
commit 80f1de728c
2 changed files with 28 additions and 4 deletions

View file

@ -14,22 +14,34 @@ class NFCService {
Kernel& kernel;
MAKE_LOG_FUNCTION(log, nfcLogger)
enum class Old3DSAdapterStatus : s32 {
enum class Old3DSAdapterStatus : u32 {
Idle = 0,
AttemptingToInitialize = 1,
InitializationComplete = 2,
// Other values are errors according to 3DBrew, set the not initialized error to -1 until we find out what it should be
NotInitialized = -1,
Active = 3,
};
enum class TagStatus : u8 {
NotInitialized = 0,
Initialized = 1,
Scanning = 2,
InRange = 3,
OutOfRange = 4,
Loaded = 5,
};
// Kernel events signaled when an NFC tag goes in and out of range respectively
std::optional<Handle> tagInRangeEvent, tagOutOfRangeEvent;
Old3DSAdapterStatus adapterStatus;
TagStatus tagStatus;
// Service commands
void communicationGetStatus(u32 messagePointer);
void initialize(u32 messagePointer);
void getTagInRangeEvent(u32 messagePointer);
void getTagOutOfRangeEvent(u32 messagePointer);
void getTagState(u32 messagePointer);
void stopCommunication(u32 messagePointer);
public: