Implement Rot.get_func()

pull/1726/head
Daniele Forsi IU5HKX 2025-06-02 17:47:31 +02:00
rodzic cc0dbc9efd
commit bb79bbc278
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -65,8 +65,10 @@ class TestClass:
status = 0
assert rot.set_func(1, status) is None
assert rot.get_func(1) == status
status = 1
assert rot.set_func(1, status) is None
assert rot.get_func(1) == 0 # FIXME should read status
assert rot.close() is None
assert rot.state.comm_state == 0

Wyświetl plik

@ -90,6 +90,7 @@ typedef struct Rot {
ROTMETHOD0(close)
ROTMETHOD2(set_func, setting_t, int)
extern void get_func(setting_t func, int *OUTPUT);
ROTMETHOD2(set_position, azimuth_t, elevation_t)
extern void get_position(azimuth_t *OUTPUT, elevation_t *OUTPUT);
ROTMETHOD0(stop)
@ -136,6 +137,13 @@ typedef struct Rot {
};
%{
/*
* this one returns 1 value
*/
void Rot_get_func(Rot *self, setting_t func, int *status)
{
self->error_status = rot_get_func(self->rot, func, status);
}
/*
* this one returns 2 values, here is a perl example: