User Tools

Site Tools


clib:backward_support:start

Backward compatibility of Samples with Updated C-Library

  • Here We have provided all details to make old host samples compatible with new C Library.
  • In older version of c-library, there were two main support files ripdraw.h and ripdraw.c and other interface related files ripdraw-serial.c and ripdraw-spi.c.
  • Follow below mentioned steps to run old samples with new clibrary.
    • User need to use extint folder to support older sample code so copy this extint folder in the same folder hierarchy where sample (e.g “Refrigerator” or any other sample) exists.
    • extint folder will have Ripdraw_v1.h file as shown below.This Ripdraw_v1.h file will bridge old sample host code to clibrary so its having dependency on clibrary.So user need to have clibrary code outside sample folder.
    • C-library contain following folder:
  • Ripdraw_v1.h is having dependecy on Clibrary code files as shown below.
    #include "Home/Project/Ripdraw/clib/common/Ripdraw.h" 
  
    NOTE: here considering that "clib" folder exists at "Home/Project/Ripdraw/" physical location.User need to update it as per their physical directory structure.		                         	           
  • In sample's src/folder –> main.h file will include extint/Ripdraw_v1.h inplace of older ripdraw.h.
  • Need to add below mentioned macro definitions in cmakelist.txt of sample.
		
    1. ADD_DEFINITIONS(-D_RD_APP_BACKWARD=1)

    2. ADD_DEFINITIONS(-D_RD_INT_TYPE_SERIAL=1) / ADD_DEFINITIONS(-D_RD_INT_TYPE_SPI=1) 

    3. ADD_DEFINITIONS(-D_RD_APP_SAMPLE=1)
  • In cmakelist.txt include extint/common.cmake .
  • CLibrary folder structure :

base

  • cbase
    • cbase.h
    • Log.c
    • Log.h
    • Protobuffer.c
    • Protobuffer.h
    • RipdrawTypes.h
    • StringUtils.h
    • StringUtils.c

clib

  • cint
    • Ripdraw.c
    • RipdrawLinuxSerial.c
    • RipdrawLinuxSpi.c
    • RipdrawWindowsSerial.c
    • RipdrawWindowsSpi.c
  • common
    • ext
      • RipdrawEvent.c
      • RipdrawEvent.h
      • RipdrawInit.c
      • RipdrawInit.h
      • TouchEvent.c
      • TouchEvent.h
    • Ripdraw.h
    • RipdrawCommon.c
    • RipdrawCommon.h

extint

  • Ripdraw_v1.h

This file is newly created to support old host code
This header is having all definitions of old ripdraw api as per older ripdraw.h file and this
funcions will internally manage to consume update clibrary so user dont need to update host code to use new
clibrary.User just need to include this file in place of ripdraw.h

Last modified: 2014/10/09 06:46

Page Tools