PSPSDK 2024-12-16
Loading...
Searching...
No Matches
pspnet_apctl.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspnet_apctl.h - PSP networking libraries.
7 *
8 * Copyright (c) 2005 Marcus R. Brown <mrbrown@0xd6.org>
9 * Copyright (c) 2008 David Perry <tias_dp@hotmail.com>
10 *
11 * Portions based on PspPet's wifi_03 sample code.
12 *
13 */
14
15#ifndef PSPNET_APCTL_H
16#define PSPNET_APCTL_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#define PSP_NET_APCTL_STATE_DISCONNECTED 0
23#define PSP_NET_APCTL_STATE_SCANNING 1
24#define PSP_NET_APCTL_STATE_JOINING 2
25#define PSP_NET_APCTL_STATE_GETTING_IP 3
26#define PSP_NET_APCTL_STATE_GOT_IP 4
27#define PSP_NET_APCTL_STATE_EAP_AUTH 5
28#define PSP_NET_APCTL_STATE_KEY_EXCHANGE 6
29
30#define PSP_NET_APCTL_EVENT_CONNECT_REQUEST 0
31#define PSP_NET_APCTL_EVENT_SCAN_REQUEST 1
32#define PSP_NET_APCTL_EVENT_SCAN_COMPLETE 2
33#define PSP_NET_APCTL_EVENT_ESTABLISHED 3
34#define PSP_NET_APCTL_EVENT_GET_IP 4
35#define PSP_NET_APCTL_EVENT_DISCONNECT_REQUEST 5
36#define PSP_NET_APCTL_EVENT_ERROR 6
37#define PSP_NET_APCTL_EVENT_INFO 7
38#define PSP_NET_APCTL_EVENT_EAP_AUTH 8
39#define PSP_NET_APCTL_EVENT_KEY_EXCHANGE 9
40#define PSP_NET_APCTL_EVENT_RECONNECT 10
41
42#define PSP_NET_APCTL_INFO_PROFILE_NAME 0
43#define PSP_NET_APCTL_INFO_BSSID 1
44#define PSP_NET_APCTL_INFO_SSID 2
45#define PSP_NET_APCTL_INFO_SSID_LENGTH 3
46#define PSP_NET_APCTL_INFO_SECURITY_TYPE 4
47#define PSP_NET_APCTL_INFO_STRENGTH 5
48#define PSP_NET_APCTL_INFO_CHANNEL 6
49#define PSP_NET_APCTL_INFO_POWER_SAVE 7
50#define PSP_NET_APCTL_INFO_IP 8
51#define PSP_NET_APCTL_INFO_SUBNETMASK 9
52#define PSP_NET_APCTL_INFO_GATEWAY 10
53#define PSP_NET_APCTL_INFO_PRIMDNS 11
54#define PSP_NET_APCTL_INFO_SECDNS 12
55#define PSP_NET_APCTL_INFO_USE_PROXY 13
56#define PSP_NET_APCTL_INFO_PROXY_URL 14
57#define PSP_NET_APCTL_INFO_PROXY_PORT 15
58#define PSP_NET_APCTL_INFO_8021_EAP_TYPE 16
59#define PSP_NET_APCTL_INFO_START_BROWSER 17
60#define PSP_NET_APCTL_INFO_WIFISP 18
61
62#define PSP_NET_APCTL_INFO_SECURITY_TYPE_NONE 0
63#define PSP_NET_APCTL_INFO_SECURITY_TYPE_WEP 1
64#define PSP_NET_APCTL_INFO_SECURITY_TYPE_WPA 2
65
67{
68 char name[64]; /* Name of the config used */
69 unsigned char bssid[6]; /* MAC address of the access point */
70 unsigned char ssid[32]; /* ssid */
71 unsigned int ssidLength; /* ssid string length*/
72 unsigned int securityType; /* 0 for none, 1 for WEP, 2 for WPA) */
73 unsigned char strength; /* Signal strength in % */
74 unsigned char channel; /* Channel */
75 unsigned char powerSave; /* 1 on, 0 off */
76 char ip[16]; /* PSP's ip */
77 char subNetMask[16]; /* Subnet mask */
78 char gateway[16]; /* Gateway */
79 char primaryDns[16]; /* Primary DNS */
80 char secondaryDns[16]; /* Secondary DNS */
81 unsigned int useProxy; /* 1 for proxy, 0 for no proxy */
82 char proxyUrl[128]; /* Proxy url */
83 unsigned short proxyPort; /* Proxy port */
84 unsigned int eapType; /* 0 is none, 1 is EAP-MD5 */
85 unsigned int startBrowser; /* Should browser be started */
86 unsigned int wifisp; /* 1 if connection is for Wifi service providers (WISP) */
87
88};
89
90typedef void (*sceNetApctlHandler)(int oldState, int newState, int event, int error, void *pArg);
91
101int sceNetApctlInit(int stackSize, int initPriority);
102
109
120
131
140
149
156
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* PSPNET_APCTL_H */
int sceNetApctlGetInfo(int code, union SceNetApctlInfo *pInfo)
Get the apctl information.
int sceNetApctlAddHandler(sceNetApctlHandler handler, void *pArg)
Add an apctl event handler.
int sceNetApctlInit(int stackSize, int initPriority)
Init the apctl.
int sceNetApctlTerm(void)
Terminate the apctl.
int sceNetApctlConnect(int connIndex)
Connect to an access point.
int sceNetApctlDisconnect(void)
Disconnect from an access point.
int sceNetApctlDelHandler(int handlerId)
Delete an apctl event handler.
int sceNetApctlGetState(int *pState)
Get the state of the access point connection.
void(* sceNetApctlHandler)(int oldState, int newState, int event, int error, void *pArg)
Definition pspnet_apctl.h:90
float x
Definition psptypes.h:0
Definition pspnet_apctl.h:67
unsigned int securityType
Definition pspnet_apctl.h:72
unsigned int eapType
Definition pspnet_apctl.h:84
unsigned char bssid[6]
Definition pspnet_apctl.h:69
char primaryDns[16]
Definition pspnet_apctl.h:79
unsigned char ssid[32]
Definition pspnet_apctl.h:70
unsigned char powerSave
Definition pspnet_apctl.h:75
unsigned int useProxy
Definition pspnet_apctl.h:81
unsigned short proxyPort
Definition pspnet_apctl.h:83
unsigned char strength
Definition pspnet_apctl.h:73
char proxyUrl[128]
Definition pspnet_apctl.h:82
unsigned char channel
Definition pspnet_apctl.h:74
char gateway[16]
Definition pspnet_apctl.h:78
unsigned int ssidLength
Definition pspnet_apctl.h:71
unsigned int startBrowser
Definition pspnet_apctl.h:85
char subNetMask[16]
Definition pspnet_apctl.h:77
char secondaryDns[16]
Definition pspnet_apctl.h:80
char ip[16]
Definition pspnet_apctl.h:76
unsigned int wifisp
Definition pspnet_apctl.h:86
char name[64]
Definition pspnet_apctl.h:68