use message id for SpringBoardAccess

This commit is contained in:
matthias.ringwald 2009-10-25 17:14:20 +00:00
parent 7befd7793b
commit c540f1ebf5
3 changed files with 7 additions and 11 deletions

View File

@ -19,13 +19,9 @@ static int SBA_sendMessage(UInt8 cmd, UInt16 dataLen, UInt8 *data){
if (!springBoardAccessMessagePort) {
return kCFMessagePortIsInvalid;
}
// create message
int messageLen = 1 + dataLen;
UInt8 message[messageLen];
message[0] = cmd;
memcpy(&message[1], data, dataLen);
CFDataRef cfData = CFDataCreate(NULL, message, messageLen);
int result = CFMessagePortSendRequest(springBoardAccessMessagePort, 0, cfData, 1, 1, NULL, NULL);
// create and send message
CFDataRef cfData = CFDataCreate(NULL, data, dataLen);
int result = CFMessagePortSendRequest(springBoardAccessMessagePort, cmd, cfData, 1, 1, NULL, NULL);
CFRelease(cfData);
return result;
}

View File

@ -33,9 +33,9 @@ CFDataRef myCallBack(CFMessagePortRef local, SInt32 msgid, CFDataRef cfData, voi
const char *data = (const char *) CFDataGetBytePtr(cfData);
UInt16 dataLen = CFDataGetLength(cfData);
if (dataLen > 1 && data) {
NSString * name = [NSString stringWithCString:&data[1] encoding:NSASCIIStringEncoding];
switch (data[0]){
if (dataLen > 0 && data) {
NSString * name = [NSString stringWithCString:data encoding:NSASCIIStringEncoding];
switch (msgid){
case SBAC_addStatusBarImage:
[theApp addStatusBarImageNamed:name];
break;

View File

@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string>wiimote_logo_55px.png</string>
<key>CFBundleIdentifier</key>
<string>ch.ringwald.btstack.wiimote</string>
<string>ch.ringwald.wiimoteopengldemo</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>