Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 9a85cf5

Browse files
author
Roman Gezikov
committed
process_subframe() API changed
1 parent e1a795c commit 9a85cf5

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

python/swiftnav/nav_msg.pxd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ cdef extern from "libswiftnav/nav_msg.h":
4545
cdef class NavMsg:
4646
cdef nav_msg_t _thisptr
4747

48+
cdef class GpsL1CADecodedData:
49+
cdef gps_l1ca_decoded_data_t _thisptr

python/swiftnav/nav_msg.pyx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@
1111

1212
from fmt_utils import fmt_repr
1313
from time cimport gps_time_t
14-
from signal cimport gnss_signal_t
14+
from libc.string cimport memset
15+
from swiftnav.signal cimport GNSSSignal
1516

17+
cdef class GpsL1CADecodedData:
18+
def __cinit__(self):
19+
memset(&self._thisptr, 0, sizeof(self._thisptr))
20+
21+
def __getattr__(self, k):
22+
return self._thisptr.get(k)
23+
1624
cdef class NavMsg:
1725

1826
def __cinit__(self):
@@ -39,11 +47,9 @@ cdef class NavMsg:
3947
def subframe_ready(self):
4048
return subframe_ready(&self._thisptr)
4149

42-
def process_subframe(self, sid, d):
43-
cdef gps_l1ca_decoded_data_t tmp_d = d._thisptr
44-
cdef gnss_signal_t tmp_sid = sid._thisptr
45-
return process_subframe(&self._thisptr, tmp_sid, &tmp_d)
46-
50+
def process_subframe(self, GNSSSignal sid, GpsL1CADecodedData d):
51+
return process_subframe(&self._thisptr, sid._thisptr, &d._thisptr)
52+
4753
def __richcmp__(self, other, op):
4854
"""
4955
Weird Cython comparison method. See

0 commit comments

Comments
 (0)