Пример #1
0
int display_model(exword_t *d)
{
	int rsp;
	exword_model_t model;
	rsp = exword_get_model(d, &model);
	if (rsp != 0x20)
		goto fail;
	printf("Model: %s\nSub: %s\n", model.model, model.sub_model);
fail:
	return rsp;
}
Пример #2
0
Model Exword::GetModel()
{
    Model modelInfo;
    exword_model_t model;
    memset(&model, 0, sizeof(exword_model_t));
    if (IsConnected()) {
        if (exword_get_model(m_device, &model) == EXWORD_SUCCESS) {
            modelInfo = ModelDatabase::Get()->Lookup(wxString::FromAscii(model.model),
                                                     wxString::FromAscii(model.sub_model),
                                                     wxString::FromAscii(model.ext_model));
            if (modelInfo.GetSeries() == 0) {
                if ((model.capabilities & CAP_F) &&
                    (model.capabilities & CAP_C)) {
                    modelInfo = Model(5);
                } else if (model.capabilities & CAP_P) {
                    modelInfo = Model(4);
                } else {
                    modelInfo = Model(3);
                }
            }
        }
    }
    return modelInfo;
}