---
title: roIRTransmitter
slug: develop/roirtransmitter
docTags: 
createdAt: 2025-03-26T17:59:51.337Z
---

This object supports sending arbitrary remote control Infrared remote control codes using the NEC, RC5, or PHC (Pronto Hex Controls) protocols. The JavaScript equivalent is [BSIRTransmitter](docId\:OG4yl3PeFza5nKGKbgBLv).

Object Creation: The *roIRTransmitter&#x20;*&#x69;s created with an associate array.

```none
CreateObject("roIRTransmitter", config as roAssociativeArray)
```

The associative array can contain the following parameter:

- `destination`: A string value indicating the connector that will be used to output the signal.
  - "IR-out": The 3.5mm IR output connector (available on XDx30 models) or 3.5mm IR input/output connector (available on 4Kx42 and XDx32 models)
  - "Iguana": The [Iguanaworks](http://iguanaworks.net/) IR transceiver

:::hint{type="info"}
System software will not prevent you from generating both an roIRTransmitter instance set to "IR-out" and an roIRReceiver instance set to "IR-in" (i.e. configuring the 3.5mm IR connector for input and output at the same time). However, input/output performance will not be reliable.
:::

## ifMessagePort

**SetPort(message\_port\_object As Object) As Void**

Posts event messages to the attached message port.

## ifUserData

**SetUserData(user\_data As Object)**

Sets the user data that will be returned when events are raised.

**GetUserData() As Object**

Returns the user data that has previously been set via `SetUserData()`. It will return `Invalid` if no data has been set.

## ifIRTransmitter

**GetFailureReason() As String**

**Send(protocol As String, code As Dynamic) As Boolean**

Sends the specified code using the output destination set during object creation. The system currently supports two IR transmission protocols: "NEC" and "PHC" ([Pronto Hex Code](docId\:S84MPE1R1QJ7aeHgOaJhH)). This method returns True if the code was successfully transmitted, but there is no way to determine from BrightScript if the controlled device actually received it.

**AsyncSend(protocol As String, code As Dynamic) As Boolean**

Sends the specified code and generates an *roIRTransmitCompleteEvent* object upon completion. The system currently supports two IR transmission protocols: "NEC" and "PHC" ([Pronto Hex Code](docId\:S84MPE1R1QJ7aeHgOaJhH)). This method is only supported using the IR-out destination.

