예제 #1
0
 unsafe public HackRFStream StartTX()
 {
     if (mode == transceiver_mode_t.OFF)
     {
         mode            = transceiver_mode_t.TX;
         stream          = new HackRFStream(this);
         stream.callback = stream.StreamCallback;
         return(stream);
     }
     else
     {
         throw new Exception("Device is already streaming. Firstly close existing stream.");
     }
 }
예제 #2
0
 unsafe public HackRFStream StartTX() // creates hackrfstream to read interleaved IQ data. hackrf transmitter won't startup until first write operation occures
 {
     if (mode == transceiver_mode_t.OFF)
     {
         mode            = transceiver_mode_t.TX;
         stream          = new HackRFStream(this);
         stream.callback = stream.StreamCallback; // delegate is needed to get cdecl pointer to StreamCallback method
         return(stream);                          // start_tx(...) method is not called because there's no data to transmit yet
     }
     else
     {
         throw new Exception("Device is already streaming. Firstly close existing stream.");
     }
 }
예제 #3
0
 } // sets external amp on/off
 unsafe public HackRFStream StartRX()
 {
     if (mode == transceiver_mode_t.OFF)
     {
         mode            = transceiver_mode_t.RX;
         stream          = new HackRFStream(this);
         stream.callback = stream.StreamCallback;
         libhackrf.hackrf_start_rx(device, Marshal.GetFunctionPointerForDelegate <libhackrf.hackrf_delegate>(stream.callback), null);
         return(stream);
     }
     else
     {
         throw new Exception("Device is already streaming. Firstly close existing stream.");
     }
 }
예제 #4
0
 unsafe public HackRFStream StartRX() // creates hackrfstream to read interleaved IQ data and starts hackrf receiver
 {
     if (mode == transceiver_mode_t.OFF)
     {
         mode            = transceiver_mode_t.RX;
         stream          = new HackRFStream(this);
         stream.callback = stream.StreamCallback; // delegate is needed to get cdecl pointer to StreamCallback method
         libhackrf.hackrf_start_rx(device, Marshal.GetFunctionPointerForDelegate <libhackrf.hackrf_delegate>(stream.callback), null);
         return(stream);
     }
     else
     {
         throw new Exception("Device is already streaming. Firstly close existing stream.");
     }
 }