Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
yonikes
Level 7

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
0 Kudos
3 Replies
EnTerr
Level 8

Re: Using the Roku BNI interface to write code in C

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)
0 Kudos
RokuMarkn
Level 7

Re: Using the Roku BNI interface to write code in C

EnTerr's guesses are correct. There is also sample code in the test_bni sample.

--Mark
0 Kudos
yonikes
Level 7

Re: Using the Roku BNI interface to write code in C

Thanks you both.
0 Kudos