Issues with objc AllJoynCodeGenerator

asked 2015-03-05 01:05:37 -0700

dvs gravatar image

updated 2015-03-05 03:40:04 -0700

AllJoyn Core alljoyn_objc iOS AllJoynCodeGenerator.

Interface for example:

<node name="com/example/MagicBoolInterface">
    <annotation name="org.alljoyn.lang.objc" value="MagicObject"/>
    <interface name="com.example.MagicBoolInterface">
        <annotation name="org.alljoyn.lang.objc" value="MagicObjectDelegate"/>
        <property name="boolReadWriteProp" type="b" access="readwrite"/> 
        <property name="boolReadProp" type="b" access="read"/> 
        <method name="getSomeData">
            <arg name="someData" type="ay" direction="out"/>

After I use AllJoynCodeGenerator to create classes.

First problem I get inside *.mm file:

- (void)setBoolReadWriteProp:(BOOL)propertyValue
    [self addInterfaceNamed:@"com.example.MagicBoolInterface"];

    MsgArg arg;

    QStatus status = arg.Set("b", [propertyValue boolValue]);    
    if (status != ER_OK) {
        NSLog(@"ERROR: Failed to set property boolReadWriteProp on interface com.example.MagicBoolInterface. %@", [AJNStatus descriptionForStatusCode:status]);
    self.proxyBusObject->SetProperty("com.example.MagicBoolInterface", "boolReadWriteProp", arg); 


Problem in this line:

QStatus status = arg.Set("b", [propertyValue boolValue]);

because arg.Set is :

QStatus MagicObjectImpl::Set(const char* ifcName, const char* propName, MsgArg& val)

Second problem here in this place:

QStatus MagicObjectImpl::Set(const char* ifcName, const char* propName, MsgArg& val)
    QStatus status = ER_BUS_NO_SUCH_PROPERTY;

    @autoreleasepool {
        if (strcmp(ifcName, "com.example.MagicBoolInterface") == 0) 

            if (strcmp(propName, "boolReadWriteProp") == 0)
            bool propValue;
                status = val.Get("b", &propValue);
                ((id<MagicObjectDelegate>)delegate).boolReadWriteProp = [NSNumber numberWithBool:propValue];
    return status;

In this line:

((id<MagicObjectDelegate>)delegate).boolReadWriteProp = [NSNumber numberWithBool:propValue];

Because we try to assign NSNumber to BOOL, because our boolReadWriteProp is scalar:

@property (nonatomic,) BOOL boolReadWriteProp;

Third problem with getSomeData method in *.mm file:

- (AJNMessageArgument*)getSomeData
    [self addInterfaceNamed:@"com.example.MagicBoolInterface"];
    // prepare the input arguments
    Message reply(*((BusAttachment*)self.bus.handle));    
    MsgArg inArgs[0];
    // make the function call using the C++ proxy object
    QStatus status = self.proxyBusObject->MethodCall("com.example.MagicBoolInterface", "getSomeData", inArgs, 0, reply, 5000);
    if (ER_OK != status) {
        NSLog(@"ERROR: ProxyBusObject::MethodCall on com.example.MagicBoolInterface failed. %@", [AJNStatus descriptionForStatusCode:status]);

        return nil;
    // pass the output arguments back to the caller

There is no return. And the end of the method have to be something like this:

return [[AJNMessageArgument alloc] initWithHandle:&reply];

It's looks like a bugs. Who could fix it? (Or is it better to follow this instruction — https://wiki.allseenalliance.org/develop/contributing_source_code to submit my changes?)

If I right understand, problem in objcHeader.xsl and in objcSource.xsl files. For "b" type it's required to add additional exceptions or to remove exists. For "ay" type also add some rules.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2015-03-05 06:52:35 -0700

ry.jones gravatar image
Linux Foundation Staff

You should file a bug or bugs in the core project ( https://jira.allseenalliance.org/browse/ASACORE ) and then follow the instructions you linked to above to submit a fix or fixes.

edit flag offensive delete publish link more


Yes, I'm planning to do this.

dvs ( 2015-03-05 06:58:32 -0700 )edit

thank you for filing bugs!

ry.jones ( 2015-03-27 17:53:54 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-03-05 01:05:37 -0700

Seen: 80 times

Last updated: Mar 05 '15