mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-22 06:41:17 +00:00
use message id for SpringBoardAccess
This commit is contained in:
parent
7befd7793b
commit
c540f1ebf5
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user