Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yonikes
Visitor

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 3
EnTerr
Roku Guru

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
Visitor

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
Visitor

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

Thanks you both.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.