Forum Discussion

yonikes's avatar
yonikes
Visitor
10 years ago

Using the Roku BNI interface to write code in C

hi,

I'm trying to write a C code above BrightScript using the Roku BNI interface. However, the documentation of this layer is not very clear, and way it is mapped to the BrightScript calls is a bit vague.

For example, according to 'bni.h', my C code should call 'RokuBNI_createObject' that will be mapped to 'CreateObject() '. This is the prototype:

int RokuBNI_createObject(const char * obj_type,
RokuBNI_Object *params[], int num_params,
RokuBNI_Object **ret);

So what is the function returning? The object itself? if so, what is returned in 'ret'? are params[] and num_params optional, like in 'CreateObject() '?

any help will be appreciated!

Thanks

Ugi

3 Replies

  • I have no access to that documentation, nor have i used RokuBNI. Just looking at the signature though, i would guess:
    • fn returns int for success/failure

    • params are optional, so nil and 0 should work

    • pointer to the created object will be planted in the &ret you pass (allocated on your side as RokuBNI_Object* ret)
  • EnTerr's guesses are correct. There is also sample code in the test_bni sample.

    --Mark