# Implementation

## Implement your own custom signal <a href="#toc87275725" id="toc87275725"></a>

To implement a custom signal, you need to develop a C++ shared library (.dll on Windows, .so on linux). Any modern C++ IDE should be compatible. Everything you need to implement is defined in the header file **custom\_signal\_interface.h**.

All elapsed time arguments are in milliseconds, relative to the simulation start time. All PRN arguments are the legacy signal PRN number.

![](https://3843800162-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlTv44ldxHAoy4G9NPbKc%2Fuploads%2FJ4Ab1FbHPnlfmhwS2evk%2F5?alt=media)

### Implement ICustomSignal <a href="#toc87275726" id="toc87275726"></a>

At minimum, you need to implement **ICustomSignal** for your shared library to be usable by Skydel. This class is instantiated at every simulation start and destroyed at every simulation stop. In your implementation .cpp file, you **must** add the following line and replace **MyCustomSignal** with your class name:

DEFINE\_CUSTOM\_SIGNAL(MyCustomSignal)

### Implement ICustomSignalCode <a href="#toc87275727" id="toc87275727"></a>

The key function of that class is **getChips**. It is called every millisecond for every visible satellite. Your implementation must copy the code chips potentially multiplied by a navigation message bit. The chips must be the ones at transmission time, Skydel will handle the propagation delay. The chips are uint8 values of either 1 or –1, anything else leads to an undefined behavior. The *chips* buffer is guaranteed to be **getNumberOfChipsPerMSec() + getExtraAllocSize()** long but only the **getNumberOfChipsPerMSec()** will be used for the simulation. **getExtraAllocSize()** is useful if you need some padding to optimize your chips generation algorithm.

### Implement ICustomSignalNavMsg <a href="#toc87275728" id="toc87275728"></a>

Your navigation message implementation will not return anything directly to Skydel (the navigation message is modulated with the ranging code inside the DLL). It is a facility to receive simulation data (such as satellite’s ephemerides, ionospheric terms, UTC terms and polar motion terms) and set some internal state accordingly. The **buildNavMsg** function is called every **getNavMsgDurationMs()** milliseconds, aligned to the constellation's time of week. You can offset this message by returning something other than 0 in **getTOWOffset**().
