mirror of
https://github.com/Silicondust/libhdhomerun
synced 2025-08-19 13:10:02 -07:00
release 20201023
This commit is contained in:
parent
64aa1606b5
commit
7c54382fb6
6 changed files with 24 additions and 5 deletions
|
@ -95,7 +95,8 @@ static const struct hdhomerun_channelmap_range_t hdhomerun_channelmap_range_us_b
|
||||||
{ 2, 4, 57000000, 6000000},
|
{ 2, 4, 57000000, 6000000},
|
||||||
{ 5, 6, 79000000, 6000000},
|
{ 5, 6, 79000000, 6000000},
|
||||||
{ 7, 13, 177000000, 6000000},
|
{ 7, 13, 177000000, 6000000},
|
||||||
{ 14, 69, 473000000, 6000000},
|
{ 14, 36, 473000000, 6000000},
|
||||||
|
{ 38, 51, 617000000, 6000000},
|
||||||
{ 0, 0, 0, 0}
|
{ 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -165,12 +165,13 @@ static int cmd_set(const char *item, const char *value)
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
buffer = (char *)realloc(buffer, pos + 1024);
|
char *new_buffer = (char *)realloc(buffer, pos + 1024);
|
||||||
if (!buffer) {
|
if (!new_buffer) {
|
||||||
fprintf(stderr, "out of memory\n");
|
fprintf(stderr, "out of memory\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buffer = new_buffer;
|
||||||
size_t size = fread(buffer + pos, 1, 1024, stdin);
|
size_t size = fread(buffer + pos, 1, 1024, stdin);
|
||||||
pos += size;
|
pos += size;
|
||||||
|
|
||||||
|
|
|
@ -480,7 +480,7 @@ int hdhomerun_device_get_tuner_status(struct hdhomerun_device_t *hd, char **psta
|
||||||
status->raw_bits_per_second = hdhomerun_device_get_status_parse(status_str, "bps=");
|
status->raw_bits_per_second = hdhomerun_device_get_status_parse(status_str, "bps=");
|
||||||
status->packets_per_second = hdhomerun_device_get_status_parse(status_str, "pps=");
|
status->packets_per_second = hdhomerun_device_get_status_parse(status_str, "pps=");
|
||||||
|
|
||||||
status->signal_present = status->signal_strength >= 45;
|
status->signal_present = status->signal_strength >= 35;
|
||||||
|
|
||||||
if (strcmp(status->lock_str, "none") != 0) {
|
if (strcmp(status->lock_str, "none") != 0) {
|
||||||
if (status->lock_str[0] == '(') {
|
if (status->lock_str[0] == '(') {
|
||||||
|
@ -526,7 +526,7 @@ int hdhomerun_device_get_oob_status(struct hdhomerun_device_t *hd, char **pstatu
|
||||||
|
|
||||||
status->signal_strength = (unsigned int)hdhomerun_device_get_status_parse(status_str, "ss=");
|
status->signal_strength = (unsigned int)hdhomerun_device_get_status_parse(status_str, "ss=");
|
||||||
status->signal_to_noise_quality = (unsigned int)hdhomerun_device_get_status_parse(status_str, "snq=");
|
status->signal_to_noise_quality = (unsigned int)hdhomerun_device_get_status_parse(status_str, "snq=");
|
||||||
status->signal_present = status->signal_strength >= 45;
|
status->signal_present = status->signal_strength >= 35;
|
||||||
status->lock_supported = (strcmp(status->lock_str, "none") != 0);
|
status->lock_supported = (strcmp(status->lock_str, "none") != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -603,6 +603,18 @@ int hdhomerun_device_get_tuner_vstatus(struct hdhomerun_device_t *hd, char **pvs
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int hdhomerun_device_get_tuner_plpinfo(struct hdhomerun_device_t *hd, char **pplpinfo)
|
||||||
|
{
|
||||||
|
if (!hd->cs) {
|
||||||
|
hdhomerun_debug_printf(hd->dbg, "hdhomerun_device_get_tuner_plpinfo: device not set\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char name[32];
|
||||||
|
hdhomerun_sprintf(name, name + sizeof(name), "/tuner%u/plpinfo", hd->tuner);
|
||||||
|
return hdhomerun_control_get(hd->cs, name, pplpinfo, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
int hdhomerun_device_get_tuner_streaminfo(struct hdhomerun_device_t *hd, char **pstreaminfo)
|
int hdhomerun_device_get_tuner_streaminfo(struct hdhomerun_device_t *hd, char **pstreaminfo)
|
||||||
{
|
{
|
||||||
if (!hd->cs) {
|
if (!hd->cs) {
|
||||||
|
|
|
@ -105,6 +105,7 @@ extern LIBHDHOMERUN_API uint32_t hdhomerun_device_get_local_machine_addr(struct
|
||||||
*/
|
*/
|
||||||
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_status(struct hdhomerun_device_t *hd, char **pstatus_str, struct hdhomerun_tuner_status_t *status);
|
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_status(struct hdhomerun_device_t *hd, char **pstatus_str, struct hdhomerun_tuner_status_t *status);
|
||||||
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_vstatus(struct hdhomerun_device_t *hd, char **pvstatus_str, struct hdhomerun_tuner_vstatus_t *vstatus);
|
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_vstatus(struct hdhomerun_device_t *hd, char **pvstatus_str, struct hdhomerun_tuner_vstatus_t *vstatus);
|
||||||
|
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_plpinfo(struct hdhomerun_device_t *hd, char **pplpinfo);
|
||||||
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_streaminfo(struct hdhomerun_device_t *hd, char **pstreaminfo);
|
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_streaminfo(struct hdhomerun_device_t *hd, char **pstreaminfo);
|
||||||
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_channel(struct hdhomerun_device_t *hd, char **pchannel);
|
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_channel(struct hdhomerun_device_t *hd, char **pchannel);
|
||||||
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_vchannel(struct hdhomerun_device_t *hd, char **pvchannel);
|
extern LIBHDHOMERUN_API int hdhomerun_device_get_tuner_vchannel(struct hdhomerun_device_t *hd, char **pvchannel);
|
||||||
|
|
|
@ -53,6 +53,8 @@ typedef struct {
|
||||||
|
|
||||||
#define LIBHDHOMERUN_API
|
#define LIBHDHOMERUN_API
|
||||||
|
|
||||||
|
#define LIBHDHOMERUN_PACKED(x) x __attribute__((packed))
|
||||||
|
|
||||||
#if !defined(alignas) && !defined(__cplusplus)
|
#if !defined(alignas) && !defined(__cplusplus)
|
||||||
#define alignas(n) __attribute__((aligned(n)))
|
#define alignas(n) __attribute__((aligned(n)))
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -56,6 +56,8 @@
|
||||||
#define LIBHDHOMERUN_API
|
#define LIBHDHOMERUN_API
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define LIBHDHOMERUN_PACKED(x) __pragma(pack(push, 1)) x __pragma( pack(pop))
|
||||||
|
|
||||||
#if !defined(__unused)
|
#if !defined(__unused)
|
||||||
#define __unused __pragma(warning(suppress: 4100 4101))
|
#define __unused __pragma(warning(suppress: 4100 4101))
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue