MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / readEEPROM

Method readEEPROM

TransceiverRAD1/FactoryCalibration.cpp:154–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void FactoryCalibration::readEEPROM(int deviceID) {
155
156 core = new rnrad1Core(
157 deviceID,
158 RAD1_CMD_INTERFACE,
159 RAD1_CMD_ALTINTERFACE,
160 "fpga.rbf",
161 "ezusb.ihx",
162 false
163 );
164
165 bool ret;
166 std::string temp;
167 std::string temp1;
168
169 /*
170 SDR_ADDR="0x50"
171 BASEST="df"
172 MKR_ST="ff"
173 ./RAD1Cmd i2c_write $SDR_ADDR $BASEST$MKR_ST
174 sleep 1
175 */
176 ret = i2c_write(0x50, "dfff");
177 sleep(1);
178// std::cout << "i2c_write = " << ret << std::endl;
179
180 /*
181 TEMP=$( ./RAD1Cmd i2c_read $SDR_ADDR 16 )
182 sleep 1
183 */
184 temp = i2c_read(0x50, 16);
185 sleep(1);
186// std::cout << "i2c_read 16 = " << temp << std::endl;
187
188 /*
189 TEMP=$( ./RAD1Cmd i2c_read $SDR_ADDR 32 )
190 */
191 temp = i2c_read(0x50, 32);
192// std::cout << "i2c_read 32 = " << temp << std::endl;
193
194 /*
195 # parse SDR serial number
196 TEMP1=$( echo "$TEMP" | cut -c 1-4 )
197 SDRSN=$( printf '%d' 0x$TEMP1 )
198 echo "SDR Serial Number [$SDRSN] hex was [$TEMP1]"
199 */
200 temp1 = temp.substr(0, 4);
201 sdrsn = hex2dec(temp1);
202// std::cout << "SDR Serial Number [" << sdrsn << "] hex was [" << temp1 << "]" << std::endl;
203
204 /*
205 # parse RF serial number
206 TEMP1=$( echo "$TEMP" | cut -c 5-8 )
207 RFSN=$( printf '%d' 0x$TEMP1 )
208 echo "RF Serial Number [$RFSN] hex was [$TEMP1]"
209 */
210 temp1 = temp.substr(4, 4);
211 rfsn = hex2dec(temp1);

Callers 1

mainFunction · 0.80

Calls 1

~rnrad1CoreMethod · 0.80

Tested by

no test coverage detected