mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-18 17:24:14 +00:00
add the Illudium Q-36 Explosive FSK Modulator
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@237 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
1 parent
43432933a8
commit
a2e2b5bd4a
10 files changed
+385
-57
No files matched your search
@@ -107,5 +107,7 @@ void dsp_fsk_destroy(dsp_fsk_handle_t **handle);
|
||||
|
||||
void dsp_fsk_sample(dsp_fsk_handle_t *handle, double normalized_sample);
|
||||
|
||||
extern fsk_modem_definition_t fsk_modem_definitions[];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -156,7 +156,6 @@ static __inline__ int16_t teletone_dds_state_modulate_sample(teletone_dds_state_
|
||||
}
|
||||
|
||||
dds->phase_accumulator += dds->phase_rate[pindex];
|
||||
|
||||
return (int16_t) (sample * dds->scale_factor >> 15);
|
||||
}
|
||||
|
||||
|
||||
@@ -241,6 +241,46 @@ static __inline__ char *zap_clean_string(char *s)
|
||||
return s;
|
||||
}
|
||||
|
||||
struct zap_bitstream {
|
||||
uint8_t *data;
|
||||
uint32_t datalen;
|
||||
uint32_t byte_index;
|
||||
uint8_t bit_index;
|
||||
int8_t endian;
|
||||
uint8_t top;
|
||||
uint8_t bot;
|
||||
uint8_t ss;
|
||||
uint8_t ssv;
|
||||
};
|
||||
|
||||
struct zap_fsk_data_state {
|
||||
dsp_fsk_handle_t *fsk1200_handle;
|
||||
uint8_t init;
|
||||
uint8_t *buf;
|
||||
size_t bufsize;
|
||||
zap_size_t blen;
|
||||
zap_size_t bpos;
|
||||
zap_size_t dlen;
|
||||
zap_size_t ppos;
|
||||
int checksum;
|
||||
};
|
||||
|
||||
struct zap_fsk_modulator {
|
||||
teletone_dds_state_t dds;
|
||||
zap_bitstream_t bs;
|
||||
uint32_t carrier_bits_start;
|
||||
uint32_t carrier_bits_stop;
|
||||
uint32_t chan_sieze_bits;
|
||||
uint32_t bit_factor;
|
||||
uint32_t bit_accum;
|
||||
uint32_t sample_counter;
|
||||
fsk_modem_types_t modem_type;
|
||||
zap_fsk_data_state_t *fsk_data;
|
||||
zap_fsk_write_sample_t write_sample_callback;
|
||||
void *user_data;
|
||||
int16_t sample_buffer[64];
|
||||
};
|
||||
|
||||
struct zap_caller_data {
|
||||
char cid_name[80];
|
||||
char cid_num[80];
|
||||
@@ -364,11 +404,31 @@ struct zap_io_interface {
|
||||
zio_span_next_event_t next_event;
|
||||
};
|
||||
|
||||
#define zap_fsk_modulator_send_all(_it) zap_fsk_modulator_generate_chan_sieze(_it); \
|
||||
zap_fsk_modulator_generate_carrier_bits(_it, _it->carrier_bits_start); \
|
||||
zap_fsk_modulator_send_data(_it); \
|
||||
zap_fsk_modulator_generate_carrier_bits(_it, _it->carrier_bits_stop)
|
||||
|
||||
zap_status_t zap_fsk_modulator_init(zap_fsk_modulator_t *fsk_trans,
|
||||
fsk_modem_types_t modem_type,
|
||||
uint32_t sample_rate,
|
||||
zap_fsk_data_state_t *fsk_data,
|
||||
float db_level,
|
||||
uint32_t carrier_bits_start,
|
||||
uint32_t carrier_bits_stop,
|
||||
uint32_t chan_sieze_bits,
|
||||
zap_fsk_write_sample_t write_sample_callback,
|
||||
void *user_data);
|
||||
int8_t zap_bitstream_get_bit(zap_bitstream_t *bsp);
|
||||
void zap_bitstream_init(zap_bitstream_t *bsp, uint8_t *data, uint32_t datalen, zap_endian_t endian, int ss);
|
||||
zap_status_t zap_fsk_data_parse(zap_fsk_data_state_t *state, zap_size_t *type, char **data, zap_size_t *len);
|
||||
zap_status_t zap_fsk_demod_feed(zap_fsk_data_state_t *state, int16_t *data, size_t samples);
|
||||
zap_status_t zap_fsk_demod_destroy(zap_fsk_data_state_t *state);
|
||||
int zap_fsk_demod_init(zap_fsk_data_state_t *state, int rate, uint8_t *buf, size_t bufsize);
|
||||
|
||||
zap_status_t zap_fsk_data_init(zap_fsk_data_state_t *state, uint8_t *data, uint32_t datalen);
|
||||
zap_status_t zap_fsk_data_add_mdmf(zap_fsk_data_state_t *state, zap_mdmf_type_t type, int8_t *data, uint32_t datalen);
|
||||
zap_status_t zap_fsk_data_add_checksum(zap_fsk_data_state_t *state);
|
||||
zap_status_t zap_fsk_data_add_sdmf(zap_fsk_data_state_t *state, char *date, char *number);
|
||||
zap_status_t zap_channel_outgoing_call(zap_channel_t *zchan);
|
||||
void zap_channel_rotate_tokens(zap_channel_t *zchan);
|
||||
void zap_channel_clear_detected_tones(zap_channel_t *zchan);
|
||||
@@ -403,7 +463,7 @@ zap_status_t zap_global_destroy(void);
|
||||
void zap_global_set_logger(zap_logger_t logger);
|
||||
void zap_global_set_default_logger(int level);
|
||||
uint32_t zap_separate_string(char *buf, char delim, char **array, int arraylen);
|
||||
void print_bits(uint8_t *b, int bl, char *buf, int blen, int e);
|
||||
void print_bits(uint8_t *b, int bl, char *buf, int blen, int e, int ss);
|
||||
ZIO_CODEC_FUNCTION(zio_slin2ulaw);
|
||||
ZIO_CODEC_FUNCTION(zio_ulaw2slin);
|
||||
ZIO_CODEC_FUNCTION(zio_slin2alaw);
|
||||
|
||||
@@ -60,9 +60,15 @@ struct zap_io_interface;
|
||||
|
||||
#define ZAP_COMMAND_OBJ_INT *((int *)obj)
|
||||
#define ZAP_COMMAND_OBJ_CHAR_P (char *)obj
|
||||
#define ZAP_FSK_MOD_FACTOR 0x10000
|
||||
|
||||
typedef uint64_t zap_time_t;
|
||||
|
||||
typedef enum {
|
||||
ZAP_ENDIAN_BIG = 1,
|
||||
ZAP_ENDIAN_LITTLE = -1
|
||||
} zap_endian_t;
|
||||
|
||||
typedef enum {
|
||||
ZAP_CID_TYPE_SDMF = 0x04,
|
||||
ZAP_CID_TYPE_MDMF = 0x80
|
||||
@@ -75,28 +81,12 @@ typedef enum {
|
||||
MDMF_NO_NUM = 4,
|
||||
MDMF_PHONE_NAME = 7,
|
||||
MDMF_NO_NAME = 8,
|
||||
MDMF_INVALID = 9
|
||||
MDMF_ALT_ROUTE = 9,
|
||||
MDMF_INVALID = 10
|
||||
} zap_mdmf_type_t;
|
||||
#define MDMF_STRINGS "X", "DATETIME", "PHONE_NUM", "DDN", "NO_NUM", "X", "X", "PHONE_NAME", "NO_NAME", "INVALID"
|
||||
#define MDMF_STRINGS "X", "DATETIME", "PHONE_NUM", "DDN", "NO_NUM", "X", "X", "PHONE_NAME", "NO_NAME", "ALT_ROUTE", "INVALID"
|
||||
ZAP_STR2ENUM_P(zap_str2zap_mdmf_type, zap_mdmf_type2str, zap_mdmf_type_t)
|
||||
|
||||
struct zap_fsk_data_state {
|
||||
dsp_fsk_handle_t *fsk1200_handle;
|
||||
uint8_t init;
|
||||
uint8_t *buf;
|
||||
size_t bufsize;
|
||||
zap_size_t blen;
|
||||
zap_size_t bpos;
|
||||
zap_size_t dlen;
|
||||
zap_size_t ppos;
|
||||
int checksum;
|
||||
};
|
||||
typedef struct zap_fsk_data_state zap_fsk_data_state_t;
|
||||
|
||||
typedef int (*zap_fsk_data_decoder_t)(zap_fsk_data_state_t *state);
|
||||
|
||||
|
||||
|
||||
#define ZAP_TONEMAP_LEN 128
|
||||
typedef enum {
|
||||
ZAP_TONEMAP_NONE,
|
||||
@@ -364,13 +354,18 @@ typedef zap_status_t (*zio_write_t) ZIO_WRITE_ARGS ;
|
||||
#define ZAP_LOG_ALERT ZAP_PRE, ZAP_LOG_LEVEL_ALERT
|
||||
#define ZAP_LOG_EMERG ZAP_PRE, ZAP_LOG_LEVEL_EMERG
|
||||
|
||||
|
||||
typedef struct zap_fsk_data_state zap_fsk_data_state_t;
|
||||
typedef int (*zap_fsk_data_decoder_t)(zap_fsk_data_state_t *state);
|
||||
typedef zap_status_t (*zap_fsk_write_sample_t)(int16_t *buf, zap_size_t buflen, void *user_data);
|
||||
typedef void (*zap_logger_t)(char *file, const char *func, int line, int level, char *fmt, ...);
|
||||
typedef struct zap_io_interface zap_io_interface_t;
|
||||
typedef struct hashtable zap_hash_t;
|
||||
typedef struct hashtable_itr zap_hash_itr_t;
|
||||
typedef struct key zap_hash_key_t;
|
||||
typedef struct value zap_hash_val_t;
|
||||
typedef struct zap_bitstream zap_bitstream_t;
|
||||
typedef struct zap_fsk_modulator zap_fsk_modulator_t;
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
|
||||
Reference in new issue
Block a user