yonikes
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2015
05:14 AM
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
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 3
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2015
11:32 AM
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)

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2015
04:00 PM
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
--Mark
yonikes
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2015
08:06 AM
Re: Using the Roku BNI interface to write code in C
Thanks you both.