0

Send Information from BrisghtScript to NodeJS

Hi everyone,

I have enable NodeJS to my device and now I can use Javascript objects for Brightscript for example BSDeviceInfo for getting information of my device, so far  everything is ok.

Now reading the documentation(pdf): -Using JavaScript Objects for BrightScript- I assume these Javascript objects are limited and I can not get all the information that Brightscript can give me.

So, the question is anyone knows how can I send information from Brightscript to NodeJS and  maybe vice versa??

Thanks everybody

4 comments

  • 0
    Avatar
    Lyndon

     

    what information are you trying to get that you can't get via javascript?

  • 0
    Avatar
    Horacio Cruz

    Hi Lyndon,

    Thank you for asking, for example, and is just an example:

    In BS(BrightScript) I can create a roRtspStreamEvent object and use the function GetInt() to get the eventID or GetUserData() to get the user data, how can I create this object in JS to get those datas?, I repeat: it is just an example.
     
    In other hand, I simply did not how to do that and I decided change my develop to JAVA with roJRE object, and what Im doing now is run a JAVA app and from here send UDP messages to BS, now Im able to send messages from JAVA and I receive in BS, until here everything is fine, but I have some questions::
    - What Im doing now, with no success is: how can I return the response from BRS to JAVA? my JAVA APP is ready to receive the response
    - Is it possible to send an UDP message from JAVA to BS with BS Code and run it to do something with the player and get some information that I need to return to JAVA?
    - Maybe is better send from JAVA to BS a UDP message with a simple instruction and depending of the instruction BS reads a certain text file with code and execute it and send the response to JAVA, how can I do this?
     
    And in this way I can use all the BS advantages using JAVA(Im JAVA developer), and even better I don't restart the player each time I change some code, I just re-run the jar file(roJRE object), this beacuse is faster to develop without restar and I have many many players and restar all those player is a real headache even if I change just an space un some brs file, and because of that have had some problems with the client.
     
    Cheers and Thank you
     
  • 0
    Avatar
    Horacio Cruz

    Hi Lyndon,

    UPDATE:

    About this question: - What Im doing now, with no success is: how can I return the response from BRS to JAVA? my JAVA APP is ready to receive the response, is ready, now I can send an UDP message from JAVA to BS and return the result from BS to JAVA via UDP.

    Now Im working in The other 2 points that I sent above: Im trying to run some BS code sent from JAVA to the player.

    Thank you

  • 0
    Avatar
    Horacio Cruz

    Hi,

    UPDATE 2:

    About the other 2 questions about run BS code:

    What Im doing is use RUN() Function (and in this way I dont need to restart the player), and until here is working.

    Now I'm testing different ways, but I think is going to work

    Finally: Is It the best way to do the bridge between JAVA and BS??

    Is there a problem with the performance of the player if I call many times the RUN() Function??

    Thank you

Please sign in to leave a comment.