MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / close_all_files

Function close_all_files

src/microham.c:114–161  ·  view source on GitHub ↗

close all sockets and mark them free

Source from the content-addressed store, hash-verified

112// close all sockets and mark them free
113//
114static void close_all_files()
115{
116 if (uh_radio_pair[0] >= 0)
117 {
118 close(uh_radio_pair[0]);
119 }
120
121 if (uh_radio_pair[1] >= 0)
122 {
123 close(uh_radio_pair[1]);
124 }
125
126 if (uh_ptt_pair[0] >= 0)
127 {
128 close(uh_ptt_pair[0]);
129 }
130
131 if (uh_ptt_pair[1] >= 0)
132 {
133 close(uh_ptt_pair[1]);
134 }
135
136 if (uh_wkey_pair[0] >= 0)
137 {
138 close(uh_wkey_pair[0]);
139 }
140
141 if (uh_wkey_pair[1] >= 0)
142 {
143 close(uh_wkey_pair[1]);
144 }
145
146 uh_radio_pair[0] = -1;
147 uh_radio_pair[1] = -1;
148 uh_ptt_pair[0] = -1;
149 uh_ptt_pair[1] = -1;
150 uh_wkey_pair[0] = -1;
151 uh_wkey_pair[1] = -1;
152 uh_radio_in_use = 0;
153 uh_ptt_in_use = 0;
154 uh_wkey_in_use = 0;
155
156// finally, close connection to microHam device
157 if (uh_device_fd >= 0)
158 {
159 close(uh_device_fd);
160 }
161}
162
163
164static void close_microham()

Callers 2

close_microhamFunction · 0.85
start_threadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected