Editing CCAPI
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 246: | Line 246: | ||
= CCAPI 2.70 - 2.80 rev5 = | = CCAPI 2.70 - 2.80 rev5 = | ||
''' Location of ccapi.sprx ''' | |||
ccapi.sprx is renamed to sys_audio.sprx and is located to | ccapi.sprx is renamed to sys_audio.sprx and is located to /dev_flash/sys/internal/sys_audio.sprx | ||
== Packets and http Requests == | == Packets and http Requests == | ||
Port:6333 | Port:6333 | ||
Communication: HTTP | Communication: HTTP | ||
Port:1979 PS3 | Port:1979 PS3 | ||
Communication: TCP/UDP | Communication: TCP/UDP | ||
<code>static int connect_to_CAPPI(void) | <code> | ||
static int connect_to_CAPPI(void) | |||
{ | |||
struct sockaddr_in sin; | |||
int s; | |||
sin.sin_family = AF_INET; | |||
sin.sin_addr.s_addr = 0x7F000001; //127.0.0.1 (localhost) | |||
sin.sin_port = htons(6333); | |||
s = socket(AF_INET, SOCK_STREAM, 0); | |||
if (s < 0) | |||
{ | |||
return -1; | |||
} | |||
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) | |||
{ | |||
return -1; | |||
} | |||
return s; | |||
} | |||
void DoNotify(char *szFormat,int id = 0) | |||
{ | |||
char _notify_buffer[512]; | |||
snprintf(_notify_buffer, 512, "/ccapi/notify?id=%i&msg=%s",id,szFormat); | |||
send_CCAPI_request(_notify_buffer); | |||
} | |||
void ShutDownPS3() | |||
{ | |||
char _notify_buffer[512]; | |||
snprintf(_notify_buffer, 512, "/ccapi/shutdown?mode=1"); | |||
send_CCAPI_request(_notify_buffer); | |||
} | |||
void RestartPS3() { | |||
char _notify_buffer[512]; | |||
snprintf(_notify_buffer, 512, "/ccapi/shutdown?mode=2"); | |||
send_CCAPI_request(_notify_buffer); | |||
} | |||
void Buzzer(int snd = 1) | |||
{ | |||
char _notify_buffer[512]; | |||
snprintf(_notify_buffer, 512, "/ccapi/ringbuzzer?type=%i",snd); | |||
send_CCAPI_request(_notify_buffer); | |||
} | |||
</code> | |||
Source : CCAPI && Webman Http requests for sprx - Jo-Milk | Source : CCAPI && Webman Http requests for sprx - Jo-Milk | ||
https//pastebin.com/RqnvPZ0j | https//pastebin.com/RqnvPZ0j |