mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Services/NFC: Stub StartTagScanning as it should be for o3DS
This commit is contained in:
		
							parent
							
								
									b2a99043e3
								
							
						
					
					
						commit
						5ad4cf619e
					
				
					 2 changed files with 22 additions and 5 deletions
				
			
		|  | @ -3,6 +3,7 @@ | |||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include "core/hle/ipc.h" | ||||
| #include "core/hle/ipc_helpers.h" | ||||
| #include "core/hle/kernel/event.h" | ||||
| #include "core/hle/kernel/handle_table.h" | ||||
| #include "core/hle/service/nfc/nfc.h" | ||||
|  | @ -53,13 +54,23 @@ void StopCommunication(Interface* self) { | |||
| } | ||||
| 
 | ||||
| void StartTagScanning(Interface* self) { | ||||
|     u32* cmd_buff = Kernel::GetCommandBuffer(); | ||||
|     IPC::RequestParser rp(Kernel::GetCommandBuffer(), 5, 1, 0); // 0x00050040
 | ||||
|     u16 in_val = rp.Pop<u16>(); | ||||
| 
 | ||||
|     ResultCode result = RESULT_SUCCESS; | ||||
| 
 | ||||
|     // TODO(shinyquagsire23): Implement NFC tag detection, for now stub result
 | ||||
|     result = ResultCode(ErrCodes::CommandInvalidForState, ErrorModule::NFC, | ||||
|                         ErrorSummary::InvalidState, ErrorLevel::Status); | ||||
| 
 | ||||
|     if (result == RESULT_SUCCESS) { | ||||
|         nfc_tag_state = TagState::TagInRange; | ||||
|         tag_in_range_event->Signal(); | ||||
|     } | ||||
| 
 | ||||
|     cmd_buff[1] = RESULT_SUCCESS.raw; // No error
 | ||||
|     LOG_WARNING(Service_NFC, "(STUBBED) called"); | ||||
|     IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||||
|     rb.Push(result); | ||||
|     LOG_WARNING(Service_NFC, "(STUBBED) called, in_val=%04x", in_val); | ||||
| } | ||||
| 
 | ||||
| void StopTagScanning(Interface* self) { | ||||
|  |  | |||
|  | @ -12,6 +12,12 @@ class Interface; | |||
| 
 | ||||
| namespace NFC { | ||||
| 
 | ||||
| namespace ErrCodes { | ||||
| enum { | ||||
|     CommandInvalidForState = 512, | ||||
| }; | ||||
| } // namespace ErrCodes
 | ||||
| 
 | ||||
| enum class TagState : u8 { | ||||
|     NotInitialized = 0, | ||||
|     NotScanning = 1, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue