diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nifm/nifm.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 0310ce883..7055ea93e 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp | |||
| @@ -30,6 +30,19 @@ enum class RequestState : u32 { | |||
| 30 | Connected = 3, | 30 | Connected = 3, |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | enum class InternetConnectionType : u8 { | ||
| 34 | WiFi = 1, | ||
| 35 | Ethernet = 2, | ||
| 36 | }; | ||
| 37 | |||
| 38 | enum class InternetConnectionStatus : u8 { | ||
| 39 | ConnectingUnknown1, | ||
| 40 | ConnectingUnknown2, | ||
| 41 | ConnectingUnknown3, | ||
| 42 | ConnectingUnknown4, | ||
| 43 | Connected, | ||
| 44 | }; | ||
| 45 | |||
| 33 | struct IpAddressSetting { | 46 | struct IpAddressSetting { |
| 34 | bool is_automatic{}; | 47 | bool is_automatic{}; |
| 35 | Network::IPv4Address current_address{}; | 48 | Network::IPv4Address current_address{}; |
| @@ -271,6 +284,7 @@ private: | |||
| 271 | rb.Push(ResultSuccess); | 284 | rb.Push(ResultSuccess); |
| 272 | rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid | 285 | rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid |
| 273 | } | 286 | } |
| 287 | |||
| 274 | void CreateScanRequest(Kernel::HLERequestContext& ctx) { | 288 | void CreateScanRequest(Kernel::HLERequestContext& ctx) { |
| 275 | LOG_DEBUG(Service_NIFM, "called"); | 289 | LOG_DEBUG(Service_NIFM, "called"); |
| 276 | 290 | ||
| @@ -279,6 +293,7 @@ private: | |||
| 279 | rb.Push(ResultSuccess); | 293 | rb.Push(ResultSuccess); |
| 280 | rb.PushIpcInterface<IScanRequest>(system); | 294 | rb.PushIpcInterface<IScanRequest>(system); |
| 281 | } | 295 | } |
| 296 | |||
| 282 | void CreateRequest(Kernel::HLERequestContext& ctx) { | 297 | void CreateRequest(Kernel::HLERequestContext& ctx) { |
| 283 | LOG_DEBUG(Service_NIFM, "called"); | 298 | LOG_DEBUG(Service_NIFM, "called"); |
| 284 | 299 | ||
| @@ -287,6 +302,7 @@ private: | |||
| 287 | rb.Push(ResultSuccess); | 302 | rb.Push(ResultSuccess); |
| 288 | rb.PushIpcInterface<IRequest>(system); | 303 | rb.PushIpcInterface<IRequest>(system); |
| 289 | } | 304 | } |
| 305 | |||
| 290 | void GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx) { | 306 | void GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx) { |
| 291 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 307 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 292 | 308 | ||
| @@ -335,12 +351,14 @@ private: | |||
| 335 | IPC::ResponseBuilder rb{ctx, 2}; | 351 | IPC::ResponseBuilder rb{ctx, 2}; |
| 336 | rb.Push(ResultSuccess); | 352 | rb.Push(ResultSuccess); |
| 337 | } | 353 | } |
| 354 | |||
| 338 | void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { | 355 | void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { |
| 339 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 356 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 340 | 357 | ||
| 341 | IPC::ResponseBuilder rb{ctx, 2}; | 358 | IPC::ResponseBuilder rb{ctx, 2}; |
| 342 | rb.Push(ResultSuccess); | 359 | rb.Push(ResultSuccess); |
| 343 | } | 360 | } |
| 361 | |||
| 344 | void GetCurrentIpAddress(Kernel::HLERequestContext& ctx) { | 362 | void GetCurrentIpAddress(Kernel::HLERequestContext& ctx) { |
| 345 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 363 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 346 | 364 | ||
| @@ -354,6 +372,7 @@ private: | |||
| 354 | rb.Push(ResultSuccess); | 372 | rb.Push(ResultSuccess); |
| 355 | rb.PushRaw(*ipv4); | 373 | rb.PushRaw(*ipv4); |
| 356 | } | 374 | } |
| 375 | |||
| 357 | void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { | 376 | void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { |
| 358 | LOG_DEBUG(Service_NIFM, "called"); | 377 | LOG_DEBUG(Service_NIFM, "called"); |
| 359 | 378 | ||
| @@ -369,6 +388,7 @@ private: | |||
| 369 | rb.PushIpcInterface<INetworkProfile>(system); | 388 | rb.PushIpcInterface<INetworkProfile>(system); |
| 370 | rb.PushRaw<u128>(uuid); | 389 | rb.PushRaw<u128>(uuid); |
| 371 | } | 390 | } |
| 391 | |||
| 372 | void GetCurrentIpConfigInfo(Kernel::HLERequestContext& ctx) { | 392 | void GetCurrentIpConfigInfo(Kernel::HLERequestContext& ctx) { |
| 373 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 393 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 374 | 394 | ||
| @@ -405,6 +425,7 @@ private: | |||
| 405 | rb.Push(ResultSuccess); | 425 | rb.Push(ResultSuccess); |
| 406 | rb.PushRaw<IpConfigInfo>(ip_config_info); | 426 | rb.PushRaw<IpConfigInfo>(ip_config_info); |
| 407 | } | 427 | } |
| 428 | |||
| 408 | void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) { | 429 | void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) { |
| 409 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 430 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 410 | 431 | ||
| @@ -412,6 +433,24 @@ private: | |||
| 412 | rb.Push(ResultSuccess); | 433 | rb.Push(ResultSuccess); |
| 413 | rb.Push<u8>(0); | 434 | rb.Push<u8>(0); |
| 414 | } | 435 | } |
| 436 | |||
| 437 | void GetInternetConnectionStatus(Kernel::HLERequestContext& ctx) { | ||
| 438 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | ||
| 439 | |||
| 440 | struct Output { | ||
| 441 | InternetConnectionType type{InternetConnectionType::WiFi}; | ||
| 442 | u8 wifi_strength{3}; | ||
| 443 | InternetConnectionStatus state{InternetConnectionStatus::Connected}; | ||
| 444 | }; | ||
| 445 | static_assert(sizeof(Output) == 0x3, "Output has incorrect size."); | ||
| 446 | |||
| 447 | constexpr Output out{}; | ||
| 448 | |||
| 449 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 450 | rb.Push(ResultSuccess); | ||
| 451 | rb.PushRaw(out); | ||
| 452 | } | ||
| 453 | |||
| 415 | void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) { | 454 | void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) { |
| 416 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 455 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 417 | 456 | ||
| @@ -423,6 +462,7 @@ private: | |||
| 423 | rb.Push<u8>(0); | 462 | rb.Push<u8>(0); |
| 424 | } | 463 | } |
| 425 | } | 464 | } |
| 465 | |||
| 426 | void IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx) { | 466 | void IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx) { |
| 427 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 467 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 428 | 468 | ||
| @@ -456,7 +496,7 @@ IGeneralService::IGeneralService(Core::System& system_) | |||
| 456 | {15, &IGeneralService::GetCurrentIpConfigInfo, "GetCurrentIpConfigInfo"}, | 496 | {15, &IGeneralService::GetCurrentIpConfigInfo, "GetCurrentIpConfigInfo"}, |
| 457 | {16, nullptr, "SetWirelessCommunicationEnabled"}, | 497 | {16, nullptr, "SetWirelessCommunicationEnabled"}, |
| 458 | {17, &IGeneralService::IsWirelessCommunicationEnabled, "IsWirelessCommunicationEnabled"}, | 498 | {17, &IGeneralService::IsWirelessCommunicationEnabled, "IsWirelessCommunicationEnabled"}, |
| 459 | {18, nullptr, "GetInternetConnectionStatus"}, | 499 | {18, &IGeneralService::GetInternetConnectionStatus, "GetInternetConnectionStatus"}, |
| 460 | {19, nullptr, "SetEthernetCommunicationEnabled"}, | 500 | {19, nullptr, "SetEthernetCommunicationEnabled"}, |
| 461 | {20, &IGeneralService::IsEthernetCommunicationEnabled, "IsEthernetCommunicationEnabled"}, | 501 | {20, &IGeneralService::IsEthernetCommunicationEnabled, "IsEthernetCommunicationEnabled"}, |
| 462 | {21, &IGeneralService::IsAnyInternetRequestAccepted, "IsAnyInternetRequestAccepted"}, | 502 | {21, &IGeneralService::IsAnyInternetRequestAccepted, "IsAnyInternetRequestAccepted"}, |