---
title: BSCECReceiver
slug: develop/bscecreceiver
docTags: 
createdAt: 2025-03-11T07:07:17.199Z
---

For more information about available methods, refer to the [roCecInterface](docId\:ezdh3By8IIBWQKy04obzU) entry. Note that you can only use this JavaScript class to receive CEC messages. Use [BSCECTransmitter](docId\:mA-PNB9N4I6NIn_IXnr0R) to send CEC messages.

The JavaScript equivalent is [cec](docId\:sgfokqfxwmjxxOfS13HtK).

## Events

The following events are available on the *BSCECReceiver* object. They can receive an event of the type *CECReceiverEvent*. 

- `onececrxframe`
- `oncectxcomplete`

### BSCECReceiverEvent – Attributes

- `readonly attribute int status`
- `readonly attribute DOMString data`

### BSCECReceiverEvent – Methods

- `ArrayBuffer getBytes()`

## Methods

- `void Close()`: Shuts down the instance, preventing it from further consuming resources. If this method is not called, garbage collection determines when the instance will be destroyed.

## Example

```text
<script>
    function loadCec()
    {
        console.log("*** loadCec ***");

        var cec_in = new BSCECReceiver();

        cec_in.oncecrxframe = function(e){
           console.log('############ oncecrxframe: ' + e.data);
        }

        cec_in.oncectxcomplete = function(e){
           console.log('############ oncectxcomplete: ' + e.status);
        }
    }
</script>
```

